On Feb 17, 2008 1:37 AM, Robert Ryan <[EMAIL PROTECTED]> wrote:
> I have a problem with a try catch:
> #include<iostream>
> using namespace std;
> expression();
> int keep_window_open();
> int main()
> try {
> while (cin)
> cout << expression() << '\n';
> keep_window_open();
> }
You need to watch your closing braces. You don't have a closing brace
for the try clause
> catch (runtime_error& e) {
> cerr << e.what() << endl;
> int keep_window_open();
This is an invalid statement. Are you declaring a new function?
> return 1;
> }
> catch (...) {
> cerr << "exception \n";
> int keep_window_open();
Same here. This is an invalid statement
> return 2;
> }
>
>
>
> .cpp: In function `int main()':
> .cpp:11: parse error before `&' token
> .cpp:11: syntax error before `&' token
> .cpp:14: parse error before `return'
> .cpp:19: parse error before `return'
--
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
If I were to divulge it, it would overturn the world."
-- Jelaleddin Rumi