|
|
|
|
Re: Debugger: values returned from function [message #558900 is a reply to message #546061] |
Tue, 14 September 2010 19:09 |
Eclipse User |
|
|
|
Originally posted by: kgold.watson.ibm.com
Nobody wrote:
> How can I see what value was returned by some function?
>
> For example in this line of code:
>
> int val = func(f(1), g(2);
>
> I would like to see what values were returned by functions f and g.
> Without stepping inside this functions, I am interested only in returned
> values.
IMHO, the answer is "don't do that". As you found, it is hard to debug.
It also isn't very clear code.
Try instead:
x = f(1);
y = f(2);
val = func(x,y);
It's easier to understand (assuming descriptive names) and debug.
My coding style also precludes:
return func();
for the same reasons.
|
|
|
Powered by
FUDForum. Page generated in 0.04368 seconds