🎯 Objective
In essence, a pointer is a variable that stores the memory address of another variable. Using pointers allows you to directly manipulate the memory locations of variables, allowing you to manage memory and build complex data structures efficiently.
In this lab, you will practice the fundamentals of pointers, including how to declare and initialize pointers, access the memory address of a variable, and use pointers to manipulate data.
\uD83D\uDDD2 Requirements
Create your main program and code the steps in the following pseudo-code
// declare an integer variable myNumber and assign a value of 5 // declare a pointer variable myPointer of type integer // assign the memory address of myNumber to the pointer variable myPointer // print the value of myNumber // print the memory address of myNumber // print the value of the pointer variable myPointer // print the value pointed to by myPointer (which is the value of myNumber) // add 10 to the value pointed to by myPointer // print the value pointed to by myPointer (which is the value of myNumber)
Example Run:
🚚 Deliverable
Upload the following:
Full source code (.cpp files or .txt files)
Screenshot of the Console with the code executing