Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program intends to access data through pointers. Please correct the errors in the program and fill in the blanks to complete the program. Submit

This program intends to access data through pointers.

Please correct the errors in the program and fill in the blanks to complete the program.

Submit the correct code and the running result.

The result should be (???? should be an address produced by your program):

------------------------

1 2 3 4 5 6 7 8 9 10 var = 5 Address of var = ????

pointVar = ???? Content of the address pointed to by pointVar = 5

_______________

Submit the correct code and the running result.

#include

using namespace std;

int main()

{

int testscores[10] = { 1,2,3,4,5,6,7,8,9,10 };

int* p = testscore;

for (int i = 0; i < 10; i++)

cout << (p++)<<" ";

cout << endl;

int var = 5;

int* pointVar;

pointVar = &var;

cout << "var = " << var << endl;

cout << "Address of var = " << (1)______________ << endl

<< endl;

cout << "pointVar = " << (2)_________ << endl;

cout << "Content of the address pointed to by pointVar = " << (3)____________________ << endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago