Home » Categories » C » What will be the result of the following p...
What will be the result of the following p...
0
What will be the result of the following program?

char *gxxx()
{static char xxx[1024];
return xxx;
}
main()
{char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is : %s",gxxx());
}


a.The string is : string
b.The string is :Oldstring
c.Run time error/Core dump
d.Syntax error during compilation
 
Asked By : Pavi Categories : CTechnical
  Answer:   b. The string is :Oldstring
Post Your Answer
Previous Question
Next Question
Tweet
Related Questions