You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Pointer Operations• Two fundamental operations:– assignment.– dereferencing.• Assignment is used to set a pointer variable’s value tosome useful address:– int ∗ptr = &counter; // indirect addressing.– int ∗ptr = new int; // heap-dynamic variable.• Dereferencing yields the value stored at the locationrepresented by the pointer’s value– C++ uses an explicit operation via unary operator ∗:j = *ptr; // sets j to the value located at ptrLecture 0639