Question.4
A developer declares two pointers for accessing a read-only hardware register:
const int *p1 = (const int *)0x40020000; int *const p2 = (int *const)0x40020000;
Which pointer prevents modifying the register value?
Select Answer
p1 — it points to constant data (cannot write through p1)
p1
p2 — it's a constant pointer (cannot change what it points to)
p2
Both prevent writing to the register
Neither — const is just a suggestion to the compiler