资 源 简 介
描述了C++文件操作的操作方法
ios::app: 以追加的方式打开文件
ios::ate: 文件打开后定位到文件尾,ios:app就包含有此属性
ios::binary: 以二进制方式打开文件,缺省的方式是文本方式。两种方式的区别见前文
ios::in: 文件以输入方式打开
ios::out: 文件以输出方式打开
ios::nocreate: 不建立文件,所以文件不存在时打开失败
ios::noreplace:不覆盖文件,所以打开文件时如果文件存在失败
ios::trunc: 如果文件存在,把文件长度设为0 -Describes the C++ file operations How ios:: app: an additional way to open the file ios:: ate: File opened locate end of file, ios: app will contain this attribute ios:: binary: open the file in binary mode , the default way is to text mode. The difference between two ways to see above ios:: in: file to open the input mode ios:: out: file to output mode open the ios:: nocreate: do not create the document, so when you open the file does not exist failed ios:: noreplace: Do not overwrite file, so when you open the file if the file exists failed ios:: trunc: If the file exists, the file size set to 0