B
boltar2003
Hello
I have a question - why can I throw but not catch multiple objects at the
same time?
eg:
#include <stdio.h>
int main()
{
try
{
throw(1,2);
}
catch(int i)
{
printf("caught %d\n",i);
}
return 0;
}
If I have catch(int i, int j) I get a compile error with gcc but the throw
compiles fine. Also if I have brackets around the throw values it catches
the 2, if I miss out the brackets it catches the 1. Is it simply treating
the brackets as a single expression?
B2003
I have a question - why can I throw but not catch multiple objects at the
same time?
eg:
#include <stdio.h>
int main()
{
try
{
throw(1,2);
}
catch(int i)
{
printf("caught %d\n",i);
}
return 0;
}
If I have catch(int i, int j) I get a compile error with gcc but the throw
compiles fine. Also if I have brackets around the throw values it catches
the 2, if I miss out the brackets it catches the 1. Is it simply treating
the brackets as a single expression?
B2003