K
kathy
I try to read my data file line by line by using the following code:
std::fstream inFile( "data.txt", std::ios::in );
std::string line;
while ( std::getline(inFile, line) != NULL )
{
//some lines show ???.
}
Problem is I can not read some lines. I got ???. My file is txt file.I
use notepad to change some data and it works fine.
What is the problem? I guess some character is not show up in the
notepad but it have some effect on getline. Or may be it it UNICODE or
ASC II code mess up?
std::fstream inFile( "data.txt", std::ios::in );
std::string line;
while ( std::getline(inFile, line) != NULL )
{
//some lines show ???.
}
Problem is I can not read some lines. I got ???. My file is txt file.I
use notepad to change some data and it works fine.
What is the problem? I guess some character is not show up in the
notepad but it have some effect on getline. Or may be it it UNICODE or
ASC II code mess up?