Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C++ that: Prompts the user to input the value of an integer. Store that input into an int called myVar Create

Write a program in C++ that:

Prompts the user to input the value of an integer.

Store that input into an "int" called "myVar"

Create a pointer, "iptr" and store the address of "myVar" in "iptr"

Print out the value of the integer "myVar", the address of "myVar" (stored in iptr) and the value of the integer stored at the address that "iptr" is pointing to.

Create an integer array, "myArray" of size "myVar" and fill it with integers from 1 to "myVar"

Print out the values in "myArray"

Create a pointer to "myArray" called "ptrToMyArray"

Print out the values in "myArray" using "ptrToMyArray" to access each value.

Make sure that your program properly deletes everything and frees memory upon exit.

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

Explain the importance of HRM to all employees.

Answered: 1 week ago

Question

14-18 Compare the two major types of planning and control tools.

Answered: 1 week ago