我的方法是否正确,以读取包含空白和换行符(\ n)的.txt
文件?
根据我编写程序的指令,我还需要检测空格和换行符,以便可以对其进行操作。
char word_from_file;
ifstream input_file;
input_file.open (*recieved_file_name+".txt");
if (input_file.good() && input_file.is_open())
{
while (!input_file.eof())
{
input_file >> noskipws >> word_from_file;
if (*recieved_choice==1)
{
cout << *recieved_key;
encrypt (recieved_file_name,&word_from_file,recieved_key);
}
}
input_file.close();
}