Computers and Technology

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.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:30, emilyplays474
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
image
Computers and Technology, 23.06.2019 13:50, mrfishyyyy
Explain how email technologies enable the exchange of messages between users. find out the typical parts of an email address and explain each part.
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, bubbles173883
While inserting images, the picture command is usually used to insert photos from a digital camera, and the clip art command is usually used to a. edit the sizes and other characteristics of photos that have been inserted. b. take a screenshot of an image and copy it to the clipboard for pasting. c. search for drawings or other images from a library of prepared pictures. d. make illustrations using lines and shapes that are easy to manipulate.
Answers: 1
image
Computers and Technology, 25.06.2019 03:40, NBASTARK4523
Acurrent vehicle registration expires at of the first owner listed on the registration form. a. stretch and flex b. bend and break c. wear down d. bounce around
Answers: 1
Do you know the correct answer?
Implement a small program that defines a regular number type variable, and a pointer variable to the...

Questions in other subjects:

Konu
English, 07.10.2020 02:01