且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Visual C ++中创建文本文件

更新时间:2023-01-23 10:25:00

例如使用<fstream>标头提供的流类,例如任何C++书籍(甚至是不良书籍).此处的示例[ ^ ].
:)
For instance using the stream classes provided by <fstream> header, as you may find in any C++ book (even bad ones). Examples here [^].
:)


请注意,fstream是C ++,而FileOpen等方法是C,如果可以避免,则不应在C ++中使用.

而且,当然,核心问题是您需要购买一本基本的C ++书籍并阅读.
Just to note, fstream is C++, and the FileOpen, etc. methods are C and should NOT be used in C++ if you can at all avoid it.

And, of course, the core issue is that you need to buy a basic C++ book and read it.


可以使用CreateFile,ReadFile和WriteFile.
CreateFile, ReadFile, WriteFile can be used.