1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 5 char *files[500]; 6 7 int main(int argc,char * argv[])8main (int argc, char *argv[]) 9 { 10 FILE *fp; 11 int i; 12 13 for (i = 0; i < 500; i++) { 14 files[i] = tempnam (NULL, "file"); 15 if (files[i] == NULL) { 16 printf ("tempnam failed\n"); 17 exit (1); 18 } 19 printf ("file: %s\n", files[i]); 20 fp = fopen (files[i], "w"); 21 fclose (fp); 22 } 23 24 for (i = 0; i < 500; i++) 25 remove (files[i]); 26 27 return 0; 28 } 29