Can you please check my code and see if it's correct?

case 1:
outputFile.open ("addstud.txt" , ios::app);
{
cout <<endl <<endl;
cout <<"A D D S T U D E N T";
cout <<endl;
cout <<"------------------------------";
cout <<endl;
cout <<endl;
cout <<"Enter ID #: ";

cin >>loc;

outputFile <<loc;
cout <<endl;
cout <<endl;
cout <<endl;

system("pause");
system("cls");

break;
}
*******
Thanks!
*******
I don't know if my ifstream code is correct... I'm new to programming, so please bare with me... Thank you. :D
anyone? please... :(
what happens when you run it?
u must tell a little more....something like "what ur switch does" or...maybe what u want to do...
Yeah...basically right now it will just put an integer the user specifies into the file with no specific format...also, if someone puts in a character, you program will probably break.
Topic archived. No new replies allowed.