A pointer is a variable that stores the memory address of another variable as its value using & and * operators.
C / C++ Systems Programming
C / C++ Tutorial
Advertisement
Google AdSense Slot (LEADERBOARD)
Automated High-CTR Ad Rail • Set Publisher ID in config/adsense.php
Memory
7 min read
•
Chapter 5 of 6
C++ Pointers & Memory
A pointer is a variable that stores the memory address of another variable as its value using & and * operators.
Example
<!DOCTYPE html><html><body style="font-family:monospace;padding:20px;"><pre>string food = "Pizza";\nstring* ptr = &food;\ncout << ptr; // Outputs memory address (0x6dfed4)</pre></body></html>
Try it Yourself >>
Opens live sandboxed code editor
Advertisement
Google AdSense Slot (IN-ARTICLE)
Automated High-CTR Ad Rail • Set Publisher ID in config/adsense.php
Community Q&A & Discussion
Verified
No questions yet. Be the first to start the discussion!