idioCyncracies: operator precedence


I get a tingle when I see C code such as

while (*string != 0)
  putchar(*string++);

How do you suppose the compiler evaluates the expression *string++? Here’s the operator precedence table to help you figure that out.

One thought on “idioCyncracies: operator precedence

  1. If you do such a thing like that with c you should get the same message that Java throws with goto: “you have no business with this language…”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s