0

Suppose I have a variable var having a value of 3.

int var = 3;

Then I store the address of var in a pointer named point:

int * point = &var;

Now if the following operation (i.e. DEREFERENCING + POSTFIX-INCREMENT) is performed:

*point++;

what will be incremented - will the value 3 be incremented resulting in var containing the value 4, or will the value of variable point be incremented, resulting in point containing the memory address NEXT TO the memory address it previously contained?

Shy
  • 542
  • 8
  • 20
  • 1
    First google search result for `precedence pointer increment`, now you know how to Google them :) – Antti Haapala -- Слава Україні Aug 17 '17 at 06:42
  • Look at [C Operator Precedence](http://en.cppreference.com/w/c/language/operator_precedence) for such questions. Although C doesn't define precedence, this site extracts the "*effective precedence*" from C's grammar. –  Aug 17 '17 at 06:43

0 Answers0