|
-
December 3rd, 2008, 03:51 PM
#4
Re: what do these operators do?
 Originally Posted by GCDEF
*kp++ adds 1 to whatever kp is pointing to.
Actually, no, assuming that we are dealing with pointers, *kp++ increments the pointer kp, and returns what kp points to. Since the expression stands alone, its net effect is equivalent to kp++;
 Originally Posted by Lindley
That's just really bad coding. Not because it's wrong, but because it's hard to read and requires strong understanding of the order of operations to interpret.
Dunno, that someone as experienced as GCDEF can make such a mistake seems to back up your argument, but on the other hand this idiom seems rather well known, considering that many people would have seen the while (*dest++ = *src++); implementation of strcpy().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|