help with C++ code 2 errors. TAICOOWN

taicoown

Beta member
Messages
2
Plz help me with this code the errors in the Dev 4 compiler was:

parse error befor (

parse error befor else

The whol code:

#include <stdlib.h>

#include <iostream>

#include <string>

#include <fstream>

#include <windows.h>

using namespace std;

int main()

{

start:

ifstream fin;

string szLine = "";

fin.open("Stats.txt");

if(fin.fail())

{

goto start;

}

fin.seekg(NULL, ios::beg);

while getline(szLine) //Error Here

if(szLine = "helo");

{

cout << ":)" << endl;

Sleep(1000);

return 0;

}

else //Error Here

{

goto start;

}

fin.clear();

fin.close();

return 0;

}
 
The use for your getline statement is wrong.
Your else is not properly connected with any if-statement. Try to change else with if statement.
 
Back
Top Bottom