Subj : Re: Precedence... To : borland.public.cpp.borlandcpp From : "Joćo Henrique" Date : Thu Mar 18 2004 04:30 pm Thank you "Ed Mulroy [TeamB]" escreveu na mensagem news:4058da38$1@newsgroups.borland.com... > That is correct behavior. > > Post increment means the value used of the variable in the expression > is the original value. The saved value of the item ('s' in this case) > is incremented. > > -------------------- > char *s = "test"; > char c; > > c = *s++; c = *s; c = *(s++); all result in c == 't' > c = *++s; c = *(s += 1); c = *(++s); all result in c == 'e' > -------------------- > > . Ed > > > Joćo Henrique wrote in message > > news:4058d731@newsgroups.borland.com... > > > > Why this happens? > > > > char *s = "test"; > > char c = *(s++); // The c value is 't', not 'e'. Why? > > Compiler optmization? > > .