请问怎样判断txt文本是否换行
ifstream file;
char ch;
int row;
file.open( "test.txt ");
while(!file.eof())
{
ch = file.get();
//如果换行,row增加1怎么写?
}
[解决办法]
while(!file.eof())
{
ch = file.get();
if(ch == '\n ')row++; //如果换行,row增加1
}