I want to move a pointer forward one byte. But I get this error:
lvalue required as increment operand
With this code:
int **test = 0;
((char *) *test)++;
But it is fine with this:
int **test = 0;
char **t2 = (char **) test;
(*t2)++;
How do I do the latter concisely?
If you want to increment the value pointed to by a double pointer:
(* (char **) test)++;
which means de-refrence the double pointer named "test" and then increment the value it is currently pointing to.
That will increment the value the pointer is pointing too, not advance the pointer itself. That's what I think you are trying to do in your sample code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With