P
praviarun
I found that the following code catches exception on gcc 4.0
i.e it prints "caught standard exception"
try{
vector<int> test;
test.at(0); // this line throws an exception
}
catch(...)
{
printf("caught standard exception");
}
but the following code which dereferences a null pointer does not throw
an exception
try{
int *p = 0;
*p =10;
}
catch(...)
{
printf("caught dereferencing null pointer");
}
This code simply terminates without catching an exception
I am using Xcode
Please let me know how i could catch this exception
Praveen
i.e it prints "caught standard exception"
try{
vector<int> test;
test.at(0); // this line throws an exception
}
catch(...)
{
printf("caught standard exception");
}
but the following code which dereferences a null pointer does not throw
an exception
try{
int *p = 0;
*p =10;
}
catch(...)
{
printf("caught dereferencing null pointer");
}
This code simply terminates without catching an exception
I am using Xcode
Please let me know how i could catch this exception
Praveen