fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. char *tmp_name(void)
  5. {
  6. static char name[30];
  7. static int sequence = 10;
  8.  
  9. static char hoge[3];
  10.  
  11. sprintf(hoge,"%d",sequence);
  12.  
  13. strcat(name,"tmp");
  14. strcat(name,hoge);
  15.  
  16. return (name);
  17.  
  18. }
  19.  
  20. int main()
  21. {
  22. char *tmp_name(void);
  23.  
  24. printf("%s\n", tmp_name());
  25.  
  26. return (0);
  27. }
Success #stdin #stdout 0s 1720KB
stdin
Standard input is empty
stdout
tmp10