I keep getting this error and cant figure it out
thanks for the input.
runcs216p6.cxx: In function `int main()':
runcs216p6.cxx:57: error: parse error before `catch'
int main()
{
ifstream inFile;
ofstream outFile;
inFile.open("in.data");
outFile.open("out.data");
if(inFile.fail() || outFile.fail())
{
cout << "input or out file opening failed" << endl;
exit(1);
}
char n;
int counter;
counter = 0;
StackType s;
Queue q;
inFile >> n;
while(inFile)
{
if(s.IsFull())
throw "~~Stack Overflow! No Push!";
if(q.IsFull())
throw "~~Queue Overflow! No Enqueue!";
else{
s.Push(n);
q.Enqueue(n);
outFile << n;
counter++;}
inFile >> n;
}
catch(std::char * s)
{
outFile<<s;
}
return 0;
}