[OCLUG-devel] Another simple question

Chris Smith cbsmith at gmail.com
Tue May 24 00:26:27 PDT 2005


On 5/23/05, James Colannino <james at colannino.org> wrote:
> Hey everyone.  Check out the following line of code:
> 
> ebuf->size *= 2;  /* copied from one of my C books */
> 
> This must seem a stupid question, but I for the life of me can't figure
> out what the "->" and "*=" symbols mean.  I'd google if I could, but I
> wouldn't know what to look for.  Thanks in advance :)

If you're going to code in C, get the appropriate bible:

http://www.bookpool.com/sm/0131103628

That'll provide you with a great reference on C.

-> means you dereference and then access a member. So "ebuf->size" is
the same as (*ebuf).size.

"a *= b" is semantically equivalent to "a = a * b". There are issues
about order of execution since it's an operator with side effects,
which you will find clarified if you look for "codepoints" in the
index.

-- 
Chris


More information about the OCLUG-devel mailing list