Re: What is wrong with this: *p++=*s++

From: Ben Pfaff (blp_at_cs.stanford.edu)
Date: 08/07/04


Date: Fri, 06 Aug 2004 18:27:05 -0700

strixnihildom@aol.com (Strix Nihildom) writes:

>>*p++=*s++
>
> when you do stuff like this use parentheses

I disagree. This statement is idiomatic. Every C programmer
should understand what it means.

> [...] if for some reason you want it to read *(p++)= (*s++) it
> creates a different result...

No, those two expressions are equivalent.

-- 
"...what folly I commit, I dedicate to you."
--William Shakespeare, _Troilus and Cressida_


Relevant Pages

  • Re: Open letter to sun about java generics syntax
    ... > The me they smell of eau de kludge. ... When I first saw Java's Collection collection, ... Objects" and require lots of casting by the programmer. ... I don't really disagree with you on this ...
    (comp.lang.java.programmer)
  • Re: Variable declarations on one line
    ... Probably because the OP's way of initialisation is natural to a C ... programmer. ... always put parentheses everywhere. ... David A. Black / Ruby Power and Light, ...
    (comp.lang.ruby)
  • Re: First attempt to use strtoll: What am I doing wrong?
    ... compare two text files while ignoring whitespace. ... matter with you, you're a perl programmer at heart, love to omit ... same syntax works uniformly regardless of number of arguments. ... The parentheses are not part of the syntax of the return ...
    (comp.lang.c)
  • Re: [FAQ] Re: Using "return" with parantheses?
    ... any C programmer who doesn't know that parentheses are ... > optional in these cases, and others, has no business working on any real ... > parentheses suggested to you coworkers a lack of understanding. ...
    (comp.lang.c)
  • Re: Which do you prefer?
    ... I disagree ... Master Programmer is always right.. ... haven't you guys seen the pattern ...
    (microsoft.public.dotnet.languages.vb)