C library function - tmpfile()
Description
The C library function FILE *tmpfile(void) creates a temporary file in binary update mode (wb+). The temporary file created is automatically deleted when the stream is closed (fclose) or when the program terminates.
Declaration
Following is the declaration for tmpfile() function.
FILE *tmpfile(void)
Parameters
- NA
Return Value
If successful, the function returns a stream pointer to the temporary file created. If the file cannot be created, then NULL is returned.
Example
The following example shows the usage of tmpfile() function.
#include <stdio.h>
int main ()
{
FILE *fp;
fp = tmpfile();
printf("Temporary file created\n");
/* you can use tmp file here */
fclose(fp);
return(0);
}
Let us compile and run the above program to create a temporary file in /tmp folder but once your program is out, it will be deleted automatically and the program will produce the following result −
Temporary file created
C library function - tmpfile()的更多相关文章
- C library function - rewind()
Description The C library function void rewind(FILE *stream) sets the file position to the beginning ...
- C library function - freopen()
Description The C library function FILE *freopen(const char *filename, const char *mode, FILE *strea ...
- Macro definition of snprintf conflicts with Standard Library function declaration
Macro definition of snprintf conflicts with Standard Library function declaration 即将此处的宏定义注释掉,因为在VS2 ...
- [Swift]数学库函数math.h | math.h -- mathematical library function
常用数学函数 1. 三角函数 double sin (double);//正弦 double cos (double);//余弦 double tan (double);//正切 2 .反三角函数 d ...
- python bug the C library strftime function.
import timedef date2mktime(date, format_='%Y-%m-%d'): return int(time.mktime(time.strptime(date, for ...
- [工作积累] Android dynamic library & JNI_OnLoad
Bionic libc doesn't load dependencies for current .so file (diff from Windows or Linux) so a explici ...
- c++学习书籍推荐《Beyond the C++ Standard Library》下载
百度云及其他网盘下载地址:点我 作者简介 Björn Karlsson works as a Senior Software Engineer at ReadSoft, where he spends ...
- systemtap 2.8 news
* What's new in version 2.8, 2015-06-17 - SystemTap has improved support for probing golang programs ...
- 单片机main函数退出后发生什么——以stm32为例
STM32:main函数退出后发生什么? 我们都在说单片机要运行在无限循环里,不能退出,可退出之后会发生什么? 讨论STM32启动过程的文章数不胜数,可main函数结束之后会发生什么却少有讨论. 几日 ...
随机推荐
- javax.transaction.xa.XAException: java.sql.SQLException: 无法创建 XA 控制连接。(SQL 2000,SQL2005,SQL2008)
javax.transaction.xa.XAException: java.sql.SQLException:无法创建 XA 控制连接.错误: 未能找到存储过程'master..xp_sqljdbc ...
- [置顶] Jquery学习总结(二) jquery选择器详解
1.基本选择器 l ID 根据元素ID选择 l Elementname 根据元素名称选择 l Classname 根据元素css类名选择 举例: <input type=”text” id=”I ...
- git使用记录(新手入门)
最近参与了公司的项目开发,最后要用git来把代码添加到远程库,但是没怎么接触过git,记录一下使用的流程 首先,当然是先下载git,这个略过不提,下载完之后,在你想要保存代码的目录下,用git ini ...
- 在Ubuntu Kylin下安装QQ教程
下载: 下载地址:http://www.ubuntukylin.com/application/show.php?lang=cn&id=279 下载后解压得到wine-qqintl文件夹,里面 ...
- html插入视频
http://www.jb51.net/web/168548.html http://www.w3school.com.cn/html/html_media.asp
- 好用的SSH客户端 good SSH client recommended
对于经常性地要登录服务器的同志们,选择一款优秀的SSH客户端非常有必要,不仅可以提高效率,而且赏心悦目,宅的几率更大.呵呵,我就是i一枚.很出名的就是PuTTY(Windows,Linux都有的), ...
- json-encode()怎么进行解码呢?
解决中文的一种方法就是先将中文转换为另一种编码格式,然后再使用json_encode(),最后再用解码把json串进行解码.还有一种方式就在php新版本中得到了解决,在下面的代码为展示. 以下为代码示 ...
- php header()函数设置页面Cache缓存
header()函数在php的使用很大,下面我来介绍利用它实现页面缓存的一些方法,但使用header前必须注意,在它之前不能任何输出,包括空格. 手册上,我们对于cache都是写着如何设置,以便让代码 ...
- Ultra-QuickSort 分类: POJ 排序 2015-08-03 15:39 2人阅读 评论(0) 收藏
Ultra-QuickSort Time Limit: 7000MS Memory Limit: 65536K Total Submissions: 48111 Accepted: 17549 ...
- The Blacksmith学习的相关资源
1.Unity官网的Blacksmith主页 https://unity3d.com/pages/the-blacksmith 2.WRINKLE MAPS IN THE BLACKSMITH 褶皱贴 ...