Warning: implode(): Invalid arguments passed in /www/wwwroot/jobquiz.info/mdiscuss.php on line 336 What will be the output of the program? #include<stdio.h> #include<string.h> int main() { char s; char fun(); s = fun(); printf("%s\n", s); return 0; } char fun() { char buffer[30]; strcpy(buffer, "RAM"); return (buffer); } ?->(Show Answer!)
1. What will be the output of the program? #include<stdio.h> #include<string.h> int main() { char s; char fun(); s = fun(); printf("%s\n", s); return 0; } char fun() { char buffer[30]; strcpy(buffer, "RAM"); return (buffer); }
Ask Your Doubts Here
Comments
By: guest on 01 Jun 2017 06.02 pm
The output is unpredictable since buffer is an auto array and will die when the control go back to main. Thus s will be pointing to an array , which not exists.