Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » Try / catch
icon5.gif  Try / catch [message #12418] Mon, 29 October 2007 10:56 Go to previous message
pippo is currently offline  pippo
Messages: 17
Registered: October 2007
Location: Italy
Promising Member
Hello guru!
I have a question: try/catch handles only throw command or all exceptions?

I write this code:
int main()
{
   printf("start\n");
   try
   {
      int a = 0;
      int b = 0 / a;
   }
   catch(...)
   {
      printf("error\n");
   }
   printf("end\n");
   return(0);
}


Then, my program crash at line with "b=0/a".
With Ubuntu and U++ (debug mode and release mode)
and also with Windows Xp and Microsoft Visual Studio!!!
(Visual studio show a pop-up, to inform about exception).

WHY???

But, if I insert a "throw", then it jump correctly to catch(...).
I must verify all possible errors and insert my "throw"??? I don't belive!!!
Maybe I must active some flag?


10aa3a8774daeb994a88cc07572e2b6c
 
Read Message icon5.gif
Read Message
Read Message
Read Message
Read Message
Previous Topic: File List with FtpClient
Next Topic: Template problem
Goto Forum:
  


Current Time: Fri Mar 29 01:17:42 CET 2024

Total time taken to generate the page: 0.01575 seconds