Hi, I am using ubuntu (Linux) using the g ++ compiler.
I have a very strange situation, yesterday my code worked fine, I did nothing, but today it does not work. Here is my code:
ifstream file;
file.open("users.txt", ios::in);
if(file.is_open()){
int counter = 0;
string readLine;
file.seekg(0, ios::end);
if (file.tellg() == 0)
file.close();
else {
while(!file.eof()){
getline(file,readLine);
cout << "whats happening?" << readLine << endl;
// I was suppose to do process here, but i comment it for debug purposes
}
openFile.close();
}
I donβt understand why, I spent 2 hours of debugging, yesterday, he can read user data, but today I open the same projects, but I canβt read the file. I am 100% sure that the path is correct and the file has content. BUt my result:
Whats happening?
That's all, nothing more. Help me, I'm crazy to look at this stuff !!!!!!!!
source
share