⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch12-tmpfile.c

📁 linux编程精髓 源代码
💻 C
字号:
/* ch12-tmpfile.c --- demonstrate tmpfile().                      Error checking omitted for brevity */#include <stdio.h>int main(void){	static char mesg[] =		"Here's lookin' at you, kid!";	/* beats "hello, world" */	FILE *fp;	char buf[BUFSIZ];	fp = tmpfile();				/* Get temp file */	fprintf(fp, "%s", mesg);		/* Write to it */	fflush(fp);				/* Force it out */	rewind(fp);				/* Move to front */	fgets(buf, sizeof buf, fp);		/* Read contents */	printf("Got back <%s>\n", buf);		/* Print retrieved data */	fclose(fp);				/* Close file, goes away */	return 0;				/* All done */}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -