C
codefixer
Hi,
Whenever an exception is raised, I ma getting just "Abort" and not the
customized message.
Even the simplest program ,like this is aborting...
#include <iostream.h>
int main () {
char myarray[10];
try
{
for (int n=0; n<=10; n++)
{
if (n>9) throw "Out of range";
myarray[n]='z';
}
}
catch (char * str)
{
cout << "Exception: " << str << endl;
}
return 0;
}
I am running on g++ 3.2.3 on solaris.
I did try to print the values inside loop and it does print till 10 and
then Aborts.
Any idea why this is happening ?
Thanks.
Whenever an exception is raised, I ma getting just "Abort" and not the
customized message.
Even the simplest program ,like this is aborting...
#include <iostream.h>
int main () {
char myarray[10];
try
{
for (int n=0; n<=10; n++)
{
if (n>9) throw "Out of range";
myarray[n]='z';
}
}
catch (char * str)
{
cout << "Exception: " << str << endl;
}
return 0;
}
I am running on g++ 3.2.3 on solaris.
I did try to print the values inside loop and it does print till 10 and
then Aborts.
Any idea why this is happening ?
Thanks.