C++ usage of fstream

来源:互联网 发布:dna存数据阅读答案 编辑:程序博客网 时间:2024/06/13 05:56
C++ ifstream&ofstream
They are utilized to create file stream and read from or write to files.
header: fstream.h
Cautious: the in and out are at the standpoint of code. 
ofstream means output, which means output data from code to physical file.
ifstream means input, which means input data to code(show file content to command line).


Encountered problems:
-> file open failure: put the file to project root, which means the position of cpp documents.
-> ifstream needs char[], but not pointer
原创粉丝点击