PDA

View Full Version : error: expected ; before ( token in c++



gowrishankar
24th January 2009, 02:33 PM
Hello
iam using sulphur....i was trying to create a file in c++ using the statement
fstream &myFile("file.txt");

and i got the following error

error: expected ; before ( token


help me to get through this problem..

thanks in advance

bee
24th January 2009, 02:36 PM
Try with this one:

fstream myFile("file.txt", ios::in | ios::out);
without the "&" and with open-mode flags. :rolleyes: :cool:

bye!!!!!!:):):)