Most suitable way for returning the logical errors
What is most suitable way for returning the logical errors in a C plus plus program?
- 3655 Views
- 1 Answers
1 Answers
-
-
- 02 Apr
- 0 Comment
-
- Can someone please update me with the important exam dates of C Plus Plus Programming Exam?
- Is Python better than C++? Explain your answer
- What are the basic concepts of oops in C++?
- How many times will this loop execute?
- Which is the best software for C++ programming?
- What are the topics in C++? Explain your answer
- Which software is used for C and C++?
- How can I practice the questions of C Plus Plus Programming? Where to find study material?
- Online test for C plus plus language
- Early bindingand Late binding in C++
Practice Mock Test
c plus plus programming
The better way is to throw custom exception. That's why they were introduced. If you need to provide specific info, like ErrorCode or something else, you could easily extend base Exception class to do so. Main reasons are:br /br /You can ignore invalid error code returned from your funcion and this could lead you to the situation where your system state is corrupted whereas Exception is something you can't ignore.br /If your funcion does something usable then it should return some data you interested in and not the error codes, this gives you more solid design.....