A pointer is a variable which stores the address of another
variable. There are two important operators when working with pointers
in C++: the address of (&) operator and the value of (*) operator.
They have been overloaded in C++ so they may have different uses in
different contexts.
How much storage space does a pointer consume?
Use sizeof(ptr) without the '*' operator to determine the memory
utilised on your system. Irrespective of datatype or whether the
pointer points to a single variable or array, as a general rule,
pointers must use the same amount of memory space.
The & operator gives us the address of a variable and * gives us the
value of a variable at a specified address.
Please tell me something more about Pointer in C++.
variable. There are two important operators when working with pointers
in C++: the address of (&) operator and the value of (*) operator.
They have been overloaded in C++ so they may have different uses in
different contexts.
How much storage space does a pointer consume?
Use sizeof(ptr) without the '*' operator to determine the memory
utilised on your system. Irrespective of datatype or whether the
pointer points to a single variable or array, as a general rule,
pointers must use the same amount of memory space.
The & operator gives us the address of a variable and * gives us the
value of a variable at a specified address.
Please tell me something more about Pointer in C++.
Comment