www.thecareerplus.com
The CareerPlus
Home Technical Resources Programming Arrays and Pointers
Thursday 09th September 2010
 
 
What does *p++ do? Does it increment p or the value pointed by p?

Discuss it!          


The postfix "++" operator has higher precedence than prefix "*" operator. Thus, *p++
is same as *(p++); it increments the pointer p, and returns the value which p pointed
to before p was incremented. If you want to increment the value pointed to by p,
try (*p)++.

Discuss it!          

CrackTheIntervew.NET
Advertisement
 
Top! Top!