By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

fatal error C1075: end of file found before the left brace '{', how do i fix this?

P: 2
This is what I've got in my program so far.

/************************************************** *******************************/
#include <iostream> // include standard I/O library
#include <fstream> // include standard F library
#include <cctype> // include standard cc library
#include <string> // include C++ string class
using namespace std; // access standard namespace

int main( )
{
const int SIZE = 51;
string fileName = " ";
char sc1, sc2;
ifstream inFile;
int pv1, pv2;


cout << "Please enter a file name and file type: ";
cin >> fileName;
cout << fileName << endl;

inFile.open (fileName);

//if file unavailable ask user to re enter file name
while (!inFile)
{
inFile.clear();
cout << fileName << " could not be opened, please enter new file name: ";
cin >> fileName ;
cout << fileName << endl;
inFile.open (fileName);
}

cout << " State State Pop Vote Pop Vote Elect Vote Elect Vote";
" Code Name for #1 for #2 for #1 for #2";
"----- ------- --------- --------- ---------- ---------";

switch (sc1)
{ case 'A' : switch (sc2)
{ case 'B': cout << "Alabamba";
inFile >> pv1;
inFile >> pv2;
break;
case 'L':
break;
}
break;
{ case 'D' : switch (sc2)
{ case 'O':
break;
case 'W':
break;
}

return 0;
}



I'm trying to open a file and print out input from the file, and I'm no sure if I'm doing it right.
Oct 26 '10 #1
Share this Question
Share on Google+
2 Replies


P: 2
I found the reason for the error and I fixed it, now I'm having a problem writing the actual program. I'm not quite sure how to print out the data from the file
Oct 26 '10 #2

P: 1
how do u fix it pleas helpme
Jan 5 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.