C++: understanding pointers
Example:
int x = 10;
int* ptr = &x;
Pointers in C++ store the address of another variable.
Solution:
cout << *ptr; // Outputs: 10
Example: Solution:C++: understanding pointers
Pointers in C++ store the address of another variable.
int x = 10;
int* ptr = &x;
cout << *ptr; // Outputs: 10