Hello,
Can someone please explain how the following term:
Code:
( *(str+i) = *(str+j++) )
evaluates when used in the following line
Code:
while ( (*(str+i) = *(str+j++) )!= '\0' )
in the "eatspaces" function on page 302 of this book? Note that this is a function which is used in the Calculator Example, which is Ex6_09.
At first glance, I thought it was assigning the value of the pointer at *(str+j++) to *(str+i), and then checking that this wasn't the end of the line... but that doesn't seem to be quite correct. I say that's not quite correct because when I try to spread these commands over a few lines, it doesn't give the same result.
This means one of two things:
(1) My attempt to spread the code out over two lines is rubbish, with a bug in it, or
(2) My interpretation of this line of code is faulty.
Can someone please let me know which of the two problems it is?
Cheers,
- Steve.