This is a discussion on How to write error free programs in c and c++? within the C and C++ Programming forums, part of the Software Development category; Hi, I have started this thread to guide you to write a error free programs in C & C++. I ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi, I have started this thread to guide you to write a error free programs in C & C++. I have faced lot of problems in C. Here I have mentioned the code , do not use these kind of codes in your program. It will give the uncaught exceptional errors. In C or C++, we can easily try catch the errors and give the proper messages for the code. But in the following cases, we cannot trap the errors. Uncaught exceptions 1. Divide by zero a. int x = 0; 2/x2. Stack overflow a. Infinitely recursive function3. Out of memory; this may show up as an exception on some systems, others will just return NULL from the new or malloc (Visual C++'s C library returns NULL and does not throw an exception). int* p = new int;4. User or library code generated exceptions that failed to get wrapped in a try/catch. Third party code may throw exceptions under some circumstances. Your code might intentionally throw exceptions. If these miss getting caught then the exceptions will make it all the way to the top of the thread. ret = ThisFunctionThrowsAnException(); thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Karpagarajan : 03-23-2007 at 02:06 AM. |
| Sponsored Links |
| |||
| Using C++ Exceptions 1. Usage of C++ exceptions is the preferred error-handling strategy. thanks ![]()
__________________ Karpagarajan. R Necessity is the mother of invention Last edited by Karpagarajan : 03-27-2007 at 04:54 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/c-c-programming/804-how-write-error-free-programs-c-c.html | |||
| Posted By | For | Type | Date |
| Digg / Programming / Upcoming | This thread | Refback | 07-20-2007 07:37 AM |
| Digg / Programming / Upcoming | This thread | Refback | 07-20-2007 04:20 AM |
| Digg / Technology / Upcoming | This thread | Refback | 07-20-2007 03:42 AM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Top 10 P2P File Sharing Programs | Sabari | Networking & Internet Connectivity | 9 | 12-07-2007 04:18 AM |
| What’s the difference between Response.Write() andResponse.Output.Write()? | prasath | ASP and ASP.NET Programming | 1 | 07-19-2007 03:56 AM |
| How to write programs that run on XBox360 / Sony PSP? | itbarota | Game Development | 0 | 07-16-2007 12:29 AM |
| SEO programs | juol | The Lounge | 1 | 03-15-2007 10:15 AM |
| PPC Programs (Traditional) | sfod223 | Promotion Techniques | 2 | 02-20-2007 07:28 AM |