Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This question is using C++ Program. Task 1 (Pointers): Declare and initialize an integer to the value of 20. Declare an integer pointer variable that
This question is using C++ Program.
Task 1 (Pointers): Declare and initialize an integer to the value of 20. Declare an integer pointer variable that points to this integer. Point the pointer to the integer (how? Check your notes - it is done by assigning the address of the integer to the value of the pointer variable) Display on the console the value of this pointer variable. Is it an address or the integer 20? How do you display the address of the integer and how do you display the value of the integer? 1. 2. 3. 4. More advance: Add five to the integer through the pointer variable so that the integer becomes 25 Task 2 (Arrays - which themselves are pointers too): 1. 2. 3. 4. Declare an array of integers, with initial values 5, 10 and 20, in the same manner as Chapter 2.2 You may also name the array as arr. Think about what you would see in the console output when you enter coutStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started