Basics of C++ Pointers and Examples with Strings
What is a pointer?
A pointer is a variable that stores the memory address as its value.
‘&’ is used to get the memory address of the variable.
‘*’ is used to store the memory address of the variable.
How are pointers used?
Here is an example of how to use a pointer in cpp. A variable is first declared with the string “Pizza”. The memory address of the variable ‘food’ is retrieved with ‘&’. How do we store a pointer into…