11 Pointers Cheat Sheet PDF

Title 11 Pointers Cheat Sheet
Author Josh Southern
Course Advanced Programming
Institution University of Lincoln
Pages 2
File Size 221.2 KB
File Type PDF
Total Downloads 14
Total Views 154

Summary

Summary cheat sheet for C++ pointers...


Description

11 Pointers Cheat Sheet Using the & operator, we can get the memory address of a variable A Pointer however, is a variable that stores the memory address as its value, not the variable value

A variable pointer has the same data type as the variable its pointing to - The type must match Its created using the * operator

To be able to output the value stored at the memory location pointed to, you must dereference the pointer To do this, you add the * operator before the name of the variable storing the mem location when outputting; therefore the mem variable "ptr" would be "*ptr"

You can also modify the pointer's value using either the original variable, or by dereferencing the pointer...


Similar Free PDFs