请问怎么用C++将一个屏幕的内容放到另一个txt中。(描述的可能不是太好)谢谢

2025-04-11 14:16:53
推荐回答(2个)
回答(1):

我学的是c,用c的方法就是打开另一个文件,输出到里面.
用系统调用的方法就是system(echo str > b.txt);
你试试

回答(2):

我在VC6下试了下,不会死循环的
ifstream file("file.txt",ios::in);
char * str=new char[sizeof(file)]; //动态创建字符串数组

for(;!file.eof();)
{
file.getline(str, sizeof(file) );
cout< }

// system("Pause");

file.close();

return 0;