subject

Implement a small program that defines a regular number type variable, and a pointer variable to the same type of number. Create these variables before starting steps 1-11 below. Only one regular variable and one pointer variable should be created for this assignment. Use these variables for the following tasks (be sure to label each of these tasks, using comments):
1) ask the user for a value and store it in the regular variable
2) make the pointer variable point to the regular variable location
3) use both the regular variable and pointer variable to print the VALUE stored and the ADDRESS the value is stored at (four things should be printed, some will be the same)
4) use the pointer variable to allocate memory for a single value
5) store a value into this newly allocated memory
6) print the same items as in step 3 (print the original value & address as well as the newly allocated value and address)
7) deallocate the memory allocated in step 5
8) ask the user for a small number and use the pointer variable to allocate memory for an array of that size of the appropriate number type
9) store random values in all elements of this newly allocated array (use array notation)
10) print all elements of the array (use array notation)
11) deallocate any allocated memory and end the program
The files must be named lab7.cpp. Put your name and the file name as the first two (commented) lines in the file.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
Is it ok to use a does red wine clean the inside of a computer true or false
Answers: 2
question
Computers and Technology, 22.06.2019 06:00
The width of a piece of rectangular land is 5m shorter rhan 1/3 of its length .find the width of the land if the length is 60m,150m.
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
To hide gridline when you display or print a worksheet
Answers: 1
question
Computers and Technology, 22.06.2019 14:40
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
You know the right answer?
Implement a small program that defines a regular number type variable, and a pointer variable to the...
Questions
question
Mathematics, 15.10.2019 20:00
Questions on the website: 13722362