30th Jul 2020, 1:28 PM
🇨🇳Zhang Huang Wei🇨🇳
4 Answers
+ 3
fun(&I, &I) passing I refference so changes in function in i variable location reflect back in original value.. In function: *i stores *i; *j stores *i both stores same value i.e 2 *i = *i * *i now *i =4. Original actual argument value in main function also changes, and j also changes since j contains *i location and now *j also 4. Hence *j = *j * *j =4*4 =16. Now *i, *j both 16. And actual argument of main i also 16. Notice that j in main, not passed its values and not modified anywhere. So I, j in main prints 16,3 Point to be remembered &I address passing and in function works like *i (farmal) = &i (actual value).. For not to confuse, use different variable names... Hope it helps....... https://www.sololearn.com/Discuss/2416942/?ref=app
30th Jul 2020, 2:23 PM
Jayakrishna 🇮🇳
30th Jul 2020, 2:11 PM
Arctic Fox
Arctic Fox - avatar
+ 1
Thank you
30th Jul 2020, 3:13 PM
🇨🇳Zhang Huang Wei🇨🇳