value = *data_ptr++;
This assigns the result of dereferencing data_ptr to value , and then increments data_ptr . Thus, the first element of the array, which is 0, will be in value , and data_ptr will point to the second. This is because ++ has a higher priority, so it applies to data_ptr , not *data_ptr .
value = *++data_ptr;
This first increases data_ptr (so in this case it points to the third element of the array instead of the second), and then it saves the dereference result (i.e. the third element of the array, which is also 0) to value .
value = ++*data_ptr;
Here, the result of dereferencing data_ptr (the third element of the array) + 1 is saved (so, only 1, since all elements of your array are automatically initialized to 0 in this case) in value .
source share