Associativity of ++ and --
- From: "Chad" <cdalten@xxxxxxxxx>
- Date: 27 Sep 2006 20:05:21 -0700
The following question stems from p.132 in the book "The C Programming
Language", second edition by K & R.
The have
struct {
int len;
char *str;
} *p;
The question is how come parentheses are need when you go like:
(++p)->len;
but you don't need them when you go:
p++->len;
The only thing I can think of would be that in the former, the prefix
operator associates right to left,
whereas in the former, the postfix operator associates left to right.
I'm I close?
Chad
.
- Follow-Ups:
- Re: Associativity of ++ and --
- From: a . laforgia
- Re: Associativity of ++ and --
- From: lovecreatesbea...@xxxxxxxxx
- Re: Associativity of ++ and --
- Prev by Date: the difeirent bettwen the function open() with two an three parameters
- Next by Date: Re: Multidimensional array pointer problem
- Previous by thread: the difeirent bettwen the function open() with two an three parameters
- Next by thread: Re: Associativity of ++ and --
- Index(es):