Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(1) Observe the address of variable num1 and num2 (2) Observe the value of variable pointer1 and pointer2 right after variable declaration but before assignment
(1) Observe the address of variable num1 and num2 (2) Observe the value of variable pointer1 and pointer2 right after variable declaration but before assignment after assignment O (3) Output num1's and num2's values using two pointers (Can't use num1 and num2) after the assignment (4) What happen if we use dereference operator with the pointer variables after declaring pointer1 and pointer2, before assignment? #include int main(int argc, char * argv[]) { int *pointer_1, *pointer_2; int num1 = 100, num2 10; //printf("(1) Address of num1 num2: % %p ",&numi, &num2); //printf("(2) Values of pointer_1 & pointer_2 BEFORE assignement: %p%p ", pointer_1, pointer_2); pointer_1 &num1; pointer_2 = &num2; //printf("(2) Values of pointer_1 & pointer_2 AFTER assignement: %p %p ", pointer_1, pointer_2); //printf("(3) Values of *pointer_1, *pointer_2: %d %d ", *pointer_1, *pointer_2); return 0; }
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