int main()
{
string path = "c:\\encryption\\";
string searchPattern = "*.txt";
string fullSearchPath = path + searchPattern;
WIN32_FIND_DATA FindData;
HANDLE hFind;
hFind = FindFirstFile( fullSearchPath.c_str(), &FindData );
if( hFind == INVALID_HANDLE_VALUE )
{
cout << " !!! Error searching directory !!!" << endl;;
return -1;
}
do
{
string filePath = path + FindData.cFileName;
ifstream in( filePath.c_str() );
if( in )
{
//////////////////////// HERE IS PROBLEM I KNOW THAT BUT WHAT I DON'T KNOW
char s;
while (!in.eof())
{
in >> s;
cout << s << endl;
}
cout << "************************ File Completely Read *** **************************** " << endl;
///////////////////////////////////////////////////////////////////////
}
else
{
cout << " !!! Problem opening file !!!" << FindData.cFileName << "\n";
}
}
while( FindNextFile(hFind, &FindData) > 0 );
if( GetLastError() != ERROR_NO_MORE_FILES )
{
cout << " !!! Something went wrong during searching !!! " << endl;
}
return 0;
}
我正在逐个读取特定文件夹中的所有文件 对于每个文件逐个字符地阅读它。以上是我的努力 到目前为止,我陷入了一个我想要读取白色空间的部分 好吧..我该怎么办?我应该包括什么?请给我一些建议