How can I inspect end of file in next code. I try to write function that can read wchar_t symbols one by one while some define earlier symbol be read, but if EOF be read function must stop.
wchar_t wchr[1];
BOOL b = TRUE;
do
{
b = ReadFile(hReadFile, wchr, sizeof(wchar_t), &dw, NULL);
if(!b)break; //it doesn't work
tempGetLine[size] = wchr[0];
size++;
}while(wchr[0] != endSymbol);
The way to check if
ReadFileis at the end of the file is to check how many bytes it has read vs how many you requested. That is:should read: