Allocating memory to char* C language
Posted
by iSight
on Stack Overflow
See other posts from Stack Overflow
or by iSight
Published on 2010-06-04T05:31:49Z
Indexed on
2010/06/04
6:09 UTC
Read the original article
Hit count: 134
Hi,
Is it the correct way of allocating memory to a char*.
char* sides ="5";
char* tempSides;
tempSides = (char*)malloc(strlen(inSides) * sizeof(char));
© Stack Overflow or respective owner