Question
1. Given the following initializations: int X = 70; int Number = 2; int *Ptr; Ptr = &X; Assuming that: The address assigned by the
1. Given the following initializations:
int X = 70;
int Number = 2;
int *Ptr;
Ptr = &X; Assuming that:
The address assigned by the compiler to X is 01007F784
The address assigned by the compiler to Number is 01007F780 Specify if the following statements are correct or not. If correct, determine the value of each variable after the statement is executed. If wrong, explain why: Statement If correct If wrong, why? a) Ptr = Number; ptr= Number= X= b) *Ptr = Number; ptr= Number= X= c) &Ptr = Number; ptr= Number= X= d) Ptr = *Number; ptr= Number= X= e) Ptr = &Number; ptr= Number= X= f) *Ptr = *Number; ptr= Number= X= g) &Number = *Ptr; ptr= Number= X= h) *Ptr = &Number; ptr= Number= X= i) &Ptr = &Number; ptr= Number= X=
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started