how to deal with error return in c -


How does one function with error returning of a routine in C if the function call goes deeper?

Since the exception does not provide throwing mechanism, we will have to look at the returns values ​​for each function. For example, the regularity of "A" can be called "B", and "B" can be said by several other routines, so if "A" returns an error, then we should call it "B" and others Calling "B" must be checked in all routines.

If "A" is a very basic routine then this code can be complicated. Is there a solution to such a problem? Actually, here I want to get a quick return path if such an error occurs, then we only have to solve this error in one place.

I'm afraid that the way it is. Without exceptions, you have to check the return value of each function in the call series.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -