0
What's the output of this and how it's come
#include <stdio.h> void fun(int* i, int* j){ *i=*i**i; *j=*j**j; } int main() { int i=2,j=3; fun(&i,&i); printf("%d,%d",i,j); return 0; }
3 odpowiedzi
0
The ouput of the code is i = 4, j = 9
fun(&i,&j) -> means you are sending the address of i and j
in the function fun(int* i, int* j) you're pointing to the address of i and j so every operation you will do it will be saved in the main i and j and you don't need the return in the function finally for the operation you only raised the number to its power like: n to the power of n.
0
Ok we are sending (&i,&i) both same address not &j
0
Can even more explain confuseing