User forums > Help

Problem with Exceptions Handling (newbie)

(1/2) > >>

HealingAura:
Hello,
I am trying to use Exceptions Handling in my C++ program but instead I keep getting this:

"This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information."

Instead of getting the right error text printed, this text above shows up and the program quits.

Did I forgot to enable something? Something tells me it's not supposed to happen  :?

sethjackson:
It should work (if your code is right), and you haven't passed -fno-exceptions to GCC (assuming GCC).
C++ exception handling works fine for me. BTW this isn't a programming forum. ;)

HealingAura:
I use GCC compiler but I don't see this -fno-exceptions. Any idea why I get this message?

The code looks like this:

int FunctionName()
{....
     switch (num)
     { ..... default: throw "invalid number"; }
... }

int main()
{ ...
   try { ... FunctionName(); ... }
   catch(char *msg) { cout<<msg<<endl; }
... }

Pecan:

--- Quote from: sethjackson on November 29, 2006, 12:48:37 am --- BTW this is a programming forum. ;)

--- End quote ---

???

sethjackson:

--- Quote from: Pecan on November 29, 2006, 01:29:43 am ---
--- Quote from: sethjackson on November 29, 2006, 12:48:37 am --- BTW this is a programming forum. ;)

--- End quote ---

???

--- End quote ---

 :lol: :lol: :lol: :oops:

isn't :P

Navigation

[0] Message Index

[#] Next page

Go to full version