| | |
confusing parse error
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 1
Reputation:
Solved Threads: 0
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'
thanks for the input.
runcs216p6.cxx: In function `int main()':
runcs216p6.cxx:57: error: parse error before `catch'
C++ Syntax (Toggle Plain Text)
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; }
![]() |
Similar Threads
- Pesky Parse error... NUTTS! (PHP)
- Problem with strtok() for data structure creation (C++)
- C# Get Socket from TcpClient (C#)
Other Threads in the C++ Forum
- Previous Thread: need some help
- Next Thread: Help plz! C++ code help...
| Thread Tools | Search this Thread |
api application array arrays based beginner binary bmp c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph gui homeworkhelp iamthwee ifstream image input int java lib library list loop looping loops map math matrix memory multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference rpg simple sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






