Hello and I'm sorry I don't speak English well.
I know this is repetitive But I Have a problem and i've never found the answer to my problem.
Shows this error whenever I compile this code by GCC : code :
const char* myFunction()
{
static char array[] = "my string";
return array;
}
char a[101];
a=myFunction();
Error :
StackOverFlow.c: In function ‘main’:
StackOverFlow.c:51:2: error: assignment to expression with array type
16 | a=myFunction();
| ^
When I use the return value of the function directly within printf Function, it doesn't make an error.
printf ("%s", myFunction());
i dont know what's it's problem. sorry for Bad English.