View Single Post
Old 12th December 2016, 18:41   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
For some processors x=*p++; is [EDIT: compiles to] a single m/c instruction, (perhaps Intel/AMD not amongst them).

Of course it also depends upon the whole context of the code where the code fragment lives as to whether it would be
better used or avoided.

EDIT: eg perfectly acceptable here:- [especially where short strings.]
Code:
    while(*d++=*s++);   // strcpy()

    OR

    for(;*d++=*s++;);   // strcpy()
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 13th December 2016 at 23:30.
StainlessS is offline   Reply With Quote