#include
#include
#include
#include
using namespace std;
int _tmain(int argc, TCHAR* argv[])
{
TCHAR * srcfile = NULL;
TCHAR * tgtfile = NULL;
ifstream src;
ofstream tgt;
string sd;
for(int i = 1;i < argc; ++i)
{
cout<<"abc";
if(_tcscmp(argv[i], _T("-src"))==0)
{
srcfile = argv[++i];
cout<<"Source File Locate Sucessfully\n";
}
if(_tcscmp(argv[i], _T("-tgt"))==0)
{
tgtfile = argv[++i];
cout<<"Target File Locate Sucessfully\n";
}
continue;
}
src.open(srcfile,ios::in);
tgt.open(tgtfile,ios::out);
if(!src)
cout<<"srcfile empty\n";
while(getline(src,sd))
{
tgt<<sd<<endl;
}
src.close();
tgt.close();
return 0;
}
![圖片說明](http://img.ask.csdn.net/upload/201501/08/1420730932_772428.png)
求大神指點迷境,解惑啊,小弟感激不盡
文件名中有空格麼?
src.open(srcfile,ios::in);
tgt.open(tgtfile,ios::out);
在這裡下斷點調試下