Is it possible to use address-of operator alongside prefix increment on pointers in the same statement, if yes how?
Example,
#include <stdio.h>
#include <stdint.h>
void main() {
uint8_t arr_var[2];
arr_var[0] = 0xa;
arr_var[1] = 0xf;
uint8_t *ptr = arr_var;
uint8_t **dptr = &(++ptr);
}
Im getting the error
error: lvalue required as unary '&' operand
uint8_t **dptr = &(++ptr);
Is there any other alternatives rather than making it 2 separate statements (increment (ptr++
) and then address-of (&ptr
)).