function
<cstdio>
tmpfileOpen a temporary file
Creates a temporary binary file, open for update ("wb+" mode, see fopen for details) with a filename guaranteed to be different from any other existing file.The temporary file created is automatically deleted when the stream is closed (fclose) or when the program terminates normally. If the program terminates abnormally, whether the file is deleted depends on the specific system and library implementation.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* tmpfile example */
#include <stdio.h>
#include <string.h>
int main ()
{
char buffer [256];
FILE * pFile;
pFile = tmpfile ();
do {
if (!fgets(buffer,256,stdin)) break;
fputs (buffer,pFile);
} while (strlen(buffer)>1);
rewind(pFile);
while (!feof(pFile)) {
if (fgets (buffer,256,pFile) == NULL) break;
fputs (buffer,stdout);
}
fclose (pFile);
return 0;
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4