直接看代码:
#include
#include
#include
using namespace std;
int main(int argc,char* argv[])
{
tstring str = argv[0];
tint n = str.find("\\Debug");
tstring path=str.substr(0,n);
tint j = path.rfind("\\");
tstring fn=path.substr(j,path.length());
tpath = path+fn+".cpp";
tint i=1;
tchar c[1000];
tifstream ifile(path.c_str());
tofstream ofile("D:\\test.cpp");
twhile(!ifile.eof()){
ttofilettifile.getline(c,999);
ttofilet}
tifile.close();
tofile.close();
tsystem("type D:\\test.cpp");
tsystem("notepad.exe D:\\test.cpp");
tsystem("pause");
treturn 0;
}
运行效果:
-end-
本文来自投稿,不代表本人立场,如若转载,请注明出处:http://www.sosokankan.com/article/863579.html