【C】文件操作

 

文件操作:

 

1. stream方式: fstream,ifstream, ofstream

2. FILE

 

fstream:如果用了ios_base::in,如果文件不存在,就会打开失败(除非加上out和trunc属性,但是如果文件存在就会被trunc掉);

  使用了open函数,要通过is_open来判断文件是否存在;

 

(详细操作见:http://my.chinaunix.net/space.php?uid=25749806&do=blog&id=345845

   http://blog.csdn.net/jianzhanger/article/details/4203913

 

FILE: 

 

见:http://blog.csdn.net/jianzhanger/article/details/3637322

 

你可能感兴趣的:(c)