函数名: tmpfile
功 能: 以二进制方式打开暂存文件
用 法: FILE *tmpfile(void);
程序例:
#include <stdio.h>
#include <process.h>
int main(void)
{
FILE *tempfp;
tempfp = tmpfile();
if (tempfp)
printf("Temporary file created/n");
else
{
printf("Unable to create temporary file/n");
exit(1);
}
return 0;
}
tmpfile函数返回一个文件描述符,如果执行失败返回NULL。当程序执行了fclose或者退出时,资源被释放。