You do not need getopt for this program as there are no arguments. Call the executable pointers. Create variables for a character, a string, an integer, and a floating point number. Create pointers for each of those variables. Ideally, use the same name as the variable but add a p in front of the name. (For example: (total and ptotal) Ask the user to enter information for each of these variables one at a time. For each variable tell them what they should enter. (For example: “Enter a single character” or “Enter a floating point number”) Read in the information and put it in the variables. Make each pointer point to the respective variable. Print out values for the four variables without using the variables themselves. Only use the pointers. In addition print out the addresses of the memory locations that each pointer points to. You can use %p for that. Output should look like the bottom sample. Copy and paste the code and the output into a Word document and submit. Character: k Integer: 4 String: [your name without brackets] Note that this is a character array Floating Point: 6.8 Character Pointer: XXXXXXXX Integer Pointer: XXXXXXXX String Pointer: XXXXXXXX Floating Point Pointer: XXXXXXXX

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.3: Pointer Arithmetic
Problem 5E
icon
Related questions
Question

Pointer Activity

  • You do not need getopt for this program as there are no arguments. Call the executable pointers.
  1. Create variables for a character, a string, an integer, and a floating point number.
  2. Create pointers for each of those variables. Ideally, use the same name as the variable but add a p in front of the name. (For example: (total and ptotal)
  3. Ask the user to enter information for each of these variables one at a time. For each variable tell them what they should enter. (For example: “Enter a single character” or “Enter a floating point number”) Read in the information and put it in the variables.
  4. Make each pointer point to the respective variable.
  5. Print out values for the four variables without using the variables themselves. Only use the pointers.
  6. In addition print out the addresses of the memory locations that each pointer points to. You can use %p for that.
  7. Output should look like the bottom sample.
  8. Copy and paste the code and the output into a Word document and submit.

Character: k
Integer: 4
String: [your name without brackets] Note that this is a character array
Floating Point: 6.8
Character Pointer: XXXXXXXX
Integer Pointer: XXXXXXXX
String Pointer: XXXXXXXX
Floating Point Pointer: XXXXXXXX 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning