25 lines
452 B
C
25 lines
452 B
C
|
#include <stdio.h>
|
||
|
|
||
|
/* Create temporary file names using a counter */
|
||
|
|
||
|
char namebuf[13];
|
||
|
int TempCount = 0;
|
||
|
|
||
|
char *make_temp_name()
|
||
|
{
|
||
|
_snprintf( namebuf, 13, "ZZ%.6o.TMP", TempCount++ );
|
||
|
return( namebuf );
|
||
|
}
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
FILE *tf1, *tf2;
|
||
|
|
||
|
tf1 = fopen( make_temp_name(), "w" );
|
||
|
tf2 = fopen( make_temp_name(), "w" );
|
||
|
fputs( "temp file 1", tf1 );
|
||
|
fputs( "temp file 2", tf2 );
|
||
|
fclose( tf1 );
|
||
|
fclose( tf2 );
|
||
|
}
|