C Programing using CodeBlocks For each of the following, write a single statement that performs the indicated task. Assume that long integer variables value1 and value2 have been defined and that value1 has been initialized to 20000. Define the variable 1Ptr to be a pointer to an object type long. Assign the address of variable value1 to pointer variable 1ptr. Print the value of the object pointed to by 1ptr. Assign the value of the object pointed to by 1ptr to value2.. Print the value of value2. Print the address of value1. Print the address stored in 1ptr. Is the value printed the same as the address of value1? Please show each task in chronological order!

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section: Chapter Questions
Problem 8PP: (Data processing) A bank’s customer records are to be stored in a file and read into a set of arrays...
icon
Related questions
Question

C Programing using CodeBlocks

For each of the following, write a single statement that performs the indicated task. Assume that long integer variables value1 and value2 have been defined and that value1 has been initialized to 20000.

  1. Define the variable 1Ptr to be a pointer to an object type long.
  2. Assign the address of variable value1 to pointer variable 1ptr.
  3. Print the value of the object pointed to by 1ptr.
  4. Assign the value of the object pointed to by 1ptr to value2..
  5. Print the value of value2.
  6. Print the address of value1.
  7. Print the address stored in 1ptr. Is the value printed the same as the address of value1?

Please show each task in chronological order!

Expert 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