hey guys im using vi to try and compile code for school
in main i keep getting errors in the functions READ and PRINT and they say that the variable in the function call is not within the scope.
here is my code:
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
const int NAMESIZE=11;
const int FILENAMESIZE=51;
typedef char NAME_t[NAMESIZE];
typedef int GRADE_t;
typedef char FILENAME_t[FILENAMESIZE];
typedef fstream DATAFILE_t;
typedef fstream OUTFILE_t;
class cStudent
{
private:
NAME_t fname;
NAME_t lname;
GRADE_t t1;
GRADE_t t2;
GRADE_t t3;
GRADE_t t4;
GRADE_t assigngrade;
GRADE_t examgrade;
public:
cStudent();
};//end class
void READ(DATAFILE_t &DATAFILE);
void PRINT(OUTFILE_t &OUTFILE);
void Finalize(DATAFILE_t &DATAFILE, OUTFILE_t &OUTFILE);
main()
{
cStudent tempstudent;
cStudent::cStudent();
READ(DATAFILE);
PRINT(OUTFILE);
Finalize(DATAFILE,OUTFILE);
}//end main
void READ(DATAFILE_t &DATAFILE)
{
FILENAME_t inputfile;
cout<<"Enter the name of the data file:"<<endl;
cin>>inputfile;
DATAFILE.open(inputfile,ios::in);
};
void PRINT(OUTFILE_t &OUTFILE)
{
FILENAME_t outputfile;
cout<<"Enter the name of the output file to be created:"<<endl;
cin>>outputfile;
OUTFILE.open(outputfile,ios::out);
};
void Finalize(DATAFILE_t &DATAFILE, OUTFILE_t &OUTFILE)
{
cout<<"Now closing input and output files...."<<endl;
DATAFILE.close();
OUTFILE.close();
cout<<"Terminating program.....GOODBYE..."<<endl;
};
anyone have have suggestions?