A pointer however, is a variable that stores the memory address as its value.
A pointer variable points to a data type (like int or string) of the same type, and is created with the * operator. The address of the variable you're working with is assigned to the pointer:
Example
string food = "Pizza"; // A food variable of type string
string* ptr = &food; // A pointer variable, with the name ptr, that stores the address of food
Tip: There are three ways to declare pointer variables, but the first way is preferred:
string* mystring; // Preferred
string *mystring;
string * mystring;
Watch video Pointers in c++|| C++ Complete Course || Beginners to Advance| Urdu/Hindi | BJM Technologies online without registration, duration hours minute second in high quality. This video was added by user BJM Technologies 28 November 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2 once and liked it people.