Unary operators with pointer variables


If we want to increment the address of a pointer, we can make use of both the uniary operator ++ and the binary operator +

Increment the address of a pointer using +


uint32_t* pAddress = (uint32_t*) 0xFFFF0000;

  

pAddress = pAddress + 1;    // Aritmethic add

result


pAddress = 0xFFFF0004

Increment the address of a pointer using ++


uint32_t* pAddress = (uint32_t*) 0xFFFF0000;

  

pAddress++;    // Unary increment

result


pAddress = 0xFFFF0004