Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

program in this new file. In this new file, write code that will do the following: a . ( 1 point ) Declare and assign

program in this new file. In this new file, write code that will do the following:
a.(1 point) Declare and assign values to variables
i. Declare an integer variable called myInt and assign the value 15 to it.
ii. Declare a pointer variable called myPointer using the dereference operator (**) and assign it to the memory location of myInt using the address-of operator (&)
b.(1 point) Print to console
Print the memory address (this should be in hexadecimal, 1.e.,0x1234 format) of myInt (remember the address-of operator!). Then print the value contained in the variable myPointer.
ii. Print the value (this should be an integer) of myInt. Then print the value pointed to by myPointer (Hint: remember the dereference operator!)
c.(1 point) Change values and print to console
i. Reassign the value of mylnt from 15 to 10 using an assignment operator.
ii. Print the memory address (this should be in hexadecimal, i.e.,0x1234 format) of myInt (remember the address-of operator!). Then print the value contained in the variable myPointer.
iii. Print the value (this should be an integer) of myInt. Then print the value pointed to by myPointer (Hint: remember the dereference operator!)
image text in transcribed

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

More Books

Students also viewed these Databases questions