fprintf函数将格式打印到文件,非常好用(怎么没早点发现这个函数)
2017-04-03 04:51
302 查看
/* fprintf example */ #include <stdio.h> int main () { FILE * pFile; int n; char name [100]; pFile = fopen ("myfile.txt","w"); for (n=0 ; n<3 ; n++) { puts ("please, enter a name: "); gets (name); fprintf (pFile, "Name %d [%-10.10s]\n",n+1,name); } fclose (pFile); return 0; }
打印所有字符的GBK编码:
http://www.cnblogs.com/findumars/p/5557239.html
相关文章推荐
- 怎么没早点发现这个好东东呢!
- 新入的Android工程很多时候都会遇到这样的问题,R.mainactivity.xml报错,一看原来发现是R类访问不到我们的资源文件在这个时候怎么解决呢?
- 我怎么老找不到这个文件啊mirserver.rar
- 怎么取得DLL文件中的函数名列表?
- chm格式文件打开后不能浏览,怎么办?
- XP系统中莫名其妙的TMP格式文件怎么删除
- 读取ASNI/UTF8/UNICODE/UNICODE Big格式文件的通用函数
- gcc编译文件时找不到指定函数怎么办
- linux遇到rar格式的文件怎么解压
- 读写UTF8和UNICODE格式文件的一组函数
- 瞧瞧这个将CBitmap写到Bmp文件里的函数
- 关于用dom4j实现xml文件输出时格式设置的发现
- 用asp清除文件HTML格式的函数
- CSV文件格式 解析csv格式的java函数
- .prg文件中自定义了一些过程和函数'该怎么调用?
- bcp怎么导出一个表数据为带列名的csv格式文件
- 如果有时间,我有点想开发自己的数据库文件格式了,发现单机版游戏还没一种固定的数据库
- .prg文件中自定义了一些过程和函数'该怎么调用?
- 我想把格式完全一样的很多文件一下全部导入到一个新的文件里,应该怎么做?
- [伊达原创]如果fstab这个文件消失了怎么办?