用CFile类,如何判断文件末尾
我要一行一行的读取文件,如果用GetLength函数该怎么用?有没有更简单的办法?
[解决办法]
MSDN
--------------------------------------------------
virtual LPTSTR ReadString( LPTSTR lpsz, UINT nMax );
throw( CFileException );
A pointer to the buffer containing the text data. NULL if end-of-file was reached without reading any data;
这个版本, 如果返回NULL, 就到文件尾了
--------------------------------------------------
BOOL ReadString(CString& rString);
throw( CFileException );
or if boolean, FALSE if end-of-file was reached without reading any data.
这个版本, 如果返回FALSE, 就到文件尾了