I need your help... Again...
How can i combine reading from file with std::getline(file, std::string);
and UpdateData(FALSE);
? UpdateData() accepts only CString and getline only std::string, and then i try to use it like that:
std::string readbuff;
int length;
std::ifstream file("file.txt");
while(getline(file, str))
{
length = str.length();
for(int i=0; i<length; i++)
CStr[i] = str[i]; //CStr is global CString variable used at DoDataExchange;
UpdateData(FALSE);
Sleep(5000);
}
i recieve following error:
error C2106: '=' : left operand must be l-value
I know fstream has something like file.read();
but then calling this function i have to give a number of symbols that i want to read. Am i right? And i don't know how to do that. So what can i do?
And also how can i read only one line, for example just 6th line?