exception handling

September 15, 2011 at 23:32:10
Specs: Windows XP
i hav a simple try catch program where the complier gives the error as undefined symbol 'try',but in the program try,catch,throw are look like keywords.here is my program pls help how to run it.

A simple exception handling example.
#include <iostream>
void main()
cout << "Start\n";

try { // start a try block
cout << "Inside try block\n";
throw 100; // throw an error
cout << "This will not execute";
catch (int i) { // catch an error
cout << "Caught an exception -- value is: ";
cout << i << "\n";
cout << "End";

See More: exception handling

Report •

September 15, 2011 at 23:33:50
here i hav used #include<iostream.h> as a header file

Report •

September 16, 2011 at 06:18:57
If your complier doesn't support try/catch, I suggest you switch to a more standards compliant compiler.

How To Ask Questions The Smart Way

Report •

September 18, 2011 at 22:00:15
but in this compiler try catch r look like keywords,why?& which compiler version is compliant.

Report •

Related Solutions

Ask Question