fork download
  1. #include <stdio.h>
  2. char *gxxx()
  3. {static char xxx[1024];
  4. return xxx;
  5. }
  6. int main()
  7. {char *g="string";
  8. strcpy(gxxx(),g);
  9. g = gxxx();
  10. strcpy(g,"oldstring");
  11. printf("The string is : %s",gxxx());
  12. }
Success #stdin #stdout 0s 9416KB
stdin
Standard input is empty
stdout
The string is : oldstring