In the first case, you are first getting the content of pointer img_hsv.data
and then adding 10 to that value and displaying it. In the second case you are just incrementing the pointer by 10 units. This incremented value points to a memory location. So a
will contain the address of the location hence it will be different from the printed value. If you meant that *a is giving different value, then it is because of the operator precedence. In the first case, pointer is dereferened first and then 10 is added to the dereferenced value, and in the second case you are incrementing the pointer first and then dereferencing it.