在Visual C ++中创建文本文件 [英] create text files in visual C++
本文介绍了在Visual C ++中创建文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何创建,读取和写入文本文件
how do you create, read and write to a text file
推荐答案
例如使用<fstream>
标头提供的流类,例如任何C++
书籍(甚至是不良书籍).此处的示例[ ^ ].
:)
For instance using the stream classes provided by<fstream>
header, as you may find in anyC++
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.
这篇关于在Visual C ++中创建文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文