如何在VS中用C++将获得的x和y的两个数据输出到txt文件中?谢谢大家了! |
|
5分 | |
10分 |
#include <fstream>
std::fstream fileW(“a.txt”); |
5分 |
#include <fstream> int main(void) { ofstream fo("1.txt", ofstream::out); if (fo.is_open()) { char c = ""a""; int i = 10; float f = 11.0f; double d = 12.0; fo << c << ends << i << ends << f << ends << d; fo.close(); } return 0; } |