What is the answer of this question? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula gr√°tis
+ 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ūüßź - avatar
2 Respostas
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 - 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 - avatar