获得一个已打开的文本文件(openfile.txt),并把里面的内容输出到新的文本文件中(new.txt)
白羊999 2008-07-07 12:34:08 #include <afx.h>
#include <iostream.h>
void main()
{
// 读文件路径
CString filePathFrom;
filePathFrom.Format("%s", "E:\\openfile.txt");
// 读取文件
CFile filefrom;
char buf[1024];
memset(buf, 0x00, 1024);
filefrom.Open(filePathFrom, CFile::modeRead, NULL);
filefrom.Read(buf, 1024);
filefrom.Close();
// 写文件路径
CString filePathto;
filePathto.Format("%s","E:\\new.txt");
// 定入文件
CFile fileto;
fileto.Open(filePathto, CFile::modeWrite, NULL);
fileto.Write(buf, 1024);
fileto.Close();
// 清理
}
偶不明白这是什么问题?
程序报错是:
--------------------Configuration: 111 - Win32 Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/111.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
另外,“清理”工作需要做哪些操作?