whats the problem of this declaration
int getLength(char* str)
{
int i;
for(i = 0; str[i] != '\0'; i ++){}
return i;
}
void concatenate(char* s1, char* s2)
{
char temp[getLength(s1) + 1]; /* Error in this line */
}
==================================================================
Errors:
-expected constant expression
-cannot allocate an array of constant size 0
-'temp' : unknown size
Last edited on
Last edited on