Professional Documents
Culture Documents
L4-Data Types
L4-Data Types
Data Types
Example in C++:
int a = 5;
int *b = &a;
02/02/2024 05:38 AM CP 111: Principles of Programming 49
Operations on Pointers
A pointer type usually includes two fundamental
pointer operations, assignment and dereferencing.
Dereferencing is used to access or manipulate data
contained in memory location pointed to by a
pointer.
In C++, dereferencing is explicitly specified with
the (*) as a prefix unary operation.
Example: If ptr is a pointer variable with the value
7080, and the cell whose address is 7080 has the
value 206, then the statement j = *ptr sets j to 206