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