help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

does g++ 2.95.3 support exceptions?


From: Vijay Patil
Subject: does g++ 2.95.3 support exceptions?
Date: Tue, 7 May 2002 05:43:29 -0700 (PDT)

Hello 
      i'm using g++ 2.95.3 both on Linux and Sun
Solaris and tried following code

#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
        try
        {
                cout<<"Before throw"<<endl;
                char* ptr=0;
                cout<<"after throw "<<*ptr<<endl;
        }
        catch(...)
        {
                cout<<"In side catch"<<endl;
        }
        return(0);
}                 

and compiled with this command

g++ -fexceptions test.cpp

when i run a.out i get segmentation fault 
why is it so inspite of enabling exceptions ? it
should go in catch block

does any one how to enable exceptions ??

Thanks and Regards
Vijay Patil



__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]