C&&C++ 简单 文件处理

 

写一小段C&&C++文件输入输出,之前不太了解 ,请各位大牛指导。

VERSION C:

其中fscanf 的参数 :

'%d' : Scan an integer as a signed decimal number.

'%i' : Scan an integer as a signed number.

'%u' : Scan for decimal unsigned int, unsigned short, and unsigned char

'%f' : Scan a floating-point number in normal (fixed-point) notation.   

'%g', '%G' : Scan a floating-point number in either normal or exponential notation.

'%x', '%X' : Scan an integer as an unsigned hexadecimal number.   

'%o' : Scan an integer as an octal number.   

'%s' : Scan a character string. The scan terminates at whitespace.   

'%c' : Scan a character (char). No null character is added.'(space)': Space scans for whitespace characters.   

'%lf' : Scan as a double floating-point number.   

'%Lf' : Scan as a long double floating-point number.

 

出自:百度百科

 

C++ VERSION:

最奇怪的就是注释里面的  函数的参数加上& 程序才能正确运行 反之 则不能。

部分内容参考自:C++ 

更多操作也在里面。

 

 

本次是为了总结一下常用的文件读取操作。

PS:感谢C++版的各位大牛,流对象不能复制和赋值,所以一定要使用&,感谢给位。2011-03-28 10:13:44

 

 


写于  2011-03-25 17:09:53

 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值