读文件怎么转行,help!!!!
杨嚣 2002-05-27 10:20:16 我编了一个读文本文件的程序,能读出,但当文本里有两句话在不同行时,读完第一句后,还会把这句后面的空字符也读出来,哪位能帮忙,告诉我怎样才能不读这些空字符,直接去读下一行。Thank you very much!!!!!
CString string,string0,string1, string2;
CString buffer;
CString readchar;
char *buf=NULL;
int length,i,x,j,y;
CString pszFileName = m_path;
myFile.Open(pszFileName,CFile::modeRead);
length=myFile.GetLength();
buf=new char[length];
myFile.Read(buf, length);
buffer=buf;
for (i=0;i<length;i++)//
{ readchar=buffer.GetAt(i);
.......
}