Okay. I've been working on my Intro to Programming assignment. My code is as follows
(Code Starts)
#include <fstream.h>
#include <iostream.h>
#include <cstdlib>

int tn();
int ui();
int fileopen();
int uexit();
int uerror();
int uinput();
int main()
{
int tn=0;
tn=uinput();
return 0;
}
int uerror()
{
cout<<"\n Error.Try Agian. 2 to exit";
return 0;
}
int uexit()
{
cout<<"\n Thank you. Goodbye.";
return 0;
}
int fileopen()
{
char str[100];
ifstream b_file("infile.dat");
b_file>>str;
cout<<str;
b_file.close();
}
int uinput()

int tn;
int ui;

do
{
cout<<"Press 1 to view the file\n";
cout<<"Press 2 to exit\n";
cin>>ui;

switch(ui)
{
case 1:
tn=fileopen();
break;
case 2:
tn=uexit();
break;
default:
tn=uerror();
break;

}

}while (ui!=2);
return ui;
}(Code Ends)
The error messages I get are:
C:\Program Files\Microsoft Visual Studio\MyProjects\HW6\Text2.cpp(41) : warning C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored
C:\Program Files\Microsoft Visual Studio\MyProjects\HW6\Text2.cpp(41) : error C2146: syntax error : missing ';' before identifier 'tn'
C:\Program Files\Microsoft Visual Studio\MyProjects\HW6\Text2.cpp(41) : fatal error C1004: unexpected end of file found
I'm using Microsoft Visual Studio 6.0 and would appreciate it if someone out there could run this program and see where I'm making my mistake. Thanks.