outputfile

#include<iostream>
#include<fstream>

using namespace std;

int main()

int username;
int password;

{
ofstream outputfile;
outputfile.open("test")
cin>> password;
cin>> username;
outputfile.close();
return 0;

}


i keep getting a syntax error saying 'int' should be preceded by ';' and '{' : missing function header (old-style formal list?).... what am i doing wrong??
You are declaring variables between the main() function name and the beginning of the function. Don't do that; move them inside.
try moving your first { to where it is positioned under int main()
thanks guy, sorry im new to this!
Topic archived. No new replies allowed.