One function tries to pass char array to another, but without success:
char * ret() {
char buf[32];
buf[0]='1'; // buf char array contains 1
buf[31]='\0';
printf(buf);
return buf;
}
int multiline() {
char temp[32];
strcpy(temp,ret()); // temp array doesn't contain 1 after this line
temp[31]='\0';
printf(temp);
}
Please tell me, how to fix this issue?