C++ TutorialLesson 23Free preview
C++ Pointers
This lesson is part of C++ · All levels
Summary
This lesson is about pointers, which are special variables that store memory addresses from other variables. With the operator & you take the address, and with the operator * you open the content of the address. Pointer provides flexible control over data and is the basis for understanding memory management in C++.
Key points
- Pointers are declared with a *name type, e.g. int *p;.
- Operator & takes the address of a variable.
- The operator * on the pointer reads the value at the designated address.
- Pointers that are invalid or nullptr should not be deferred.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.