← Back to context

Comment by layer8

20 hours ago

The idiomatic

    void strcpy(char *s, char *t)
    {
        while (*s++ = *t++)
            ;
    }

(straight from K&R) wouldn’t work without it.

K&R actually teaches this as a desirable idiom? People should not be recommending K&R to beginners today!

Which many people find unreadable compared to other versions.

  • And for several reasons.

      * is it (*s)++ or *(s++)?
      * it is not *++s nor ++*s
    

    And I have seen

      *(*s)++
    

    in some places!

    It is concise syntax but very confusing.