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;
}

>>catch(std::char * s)

Error most likely because there is no such thing as std::char. change to this and retest: catch(const char* s)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.