+ 1

What is the answer of this question?

int=1; int *p=&i, *q; q=p; *q=5; Printf("%d", *p) ;

11th Oct 2020, 12:42 PM
Habit🧐
Habit🧐 - avatar
2 odpowiedzi
0
You declare two pointers p and q of type integer and an integer i.You set pointer p to pointing to the address of i and you assign p to q so any change made to one of them affects the other so that logical value that p will refer to is 5.
11th Oct 2020, 3:08 PM
HBhZ_C
HBhZ_C - avatar
+ 3
Click on your profile ,go to code bits section ,there you will see '+' sign ,click on it and choose the language and see the output yourself
11th Oct 2020, 12:47 PM
Abhay
Abhay - avatar