A
ARMAS
what's the difference between "y++" and "y=y+1"?
ARMAS said:what's the difference between "y++" and "y=y+1"?
Richard said:Ignoring stupid homework niggles, nothing whatsoever.
Chris Dollin said:Um ... does
The value of the expression `y++` is the original
value of `y`, while the value of the expression `y=y+1`
is the new value of `y`.
count as a "stupid homework niggle"?
[/QUOTE]Um ... does
The value of the expression `y++` is the original
value of `y`, while the value of the expression `y=y+1`
is the new value of `y`.
count as a "stupid homework niggle"?
Yes. _As written_, those two do the same thing. _In context_ they might
do completely different things - you might, for example, also #define y
call_a_complex_function(pointer_to_binary_tree) - but outside of
homework problems or job applications, I expect such a context to be
given with the problem.
Richard said:Yes.
_As written_, those two do the same thing. _In context_ they might
do completely different things - you might, for example, also #define y
call_a_complex_function(pointer_to_binary_tree) - but outside of
homework problems or job applications, I expect such a context to be
given with the problem.
ARMAS said:what's the difference between "y++" and "y=y+1"?
printf("%d\n", abs(a - b);
return 0;
}
-Mike
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.