How to find where error is.
Posted
by gurugio
on Stack Overflow
See other posts from Stack Overflow
or by gurugio
Published on 2010-05-07T05:34:23Z
Indexed on
2010/05/07
5:38 UTC
Read the original article
Hit count: 127
c
How can I find where the error occurs? In C language, the return value means what error occurs, such as failure to open file or memory allocation. There is no information where the error occurs.
For example, function 'foo' calls A,B,C,D. If foo returns an error value, it might be return value of A or B or C or D. I cannot find what function returns error. I have to run debugger or add some codes to find what function returns error.
© Stack Overflow or respective owner