+ 3
Just a quick question, can we put an address as a function argument like int f(int &x){...} ?????? (Pleaase tell me we can'tđ)
If we can than what is the difference between it and f(int *x){...} Actually our professor put on exam a code like: int f(int &x, int *y){x+=10 ;... return x;} int main(){...int a=3,b=1; printf("%d %d", f(a,&b),a); ... return 0;}something like this. then told us write the out put f(a,b)=?. a=? /*BTW I answered there is an error in the codeđ€đ€*/
4 Answers
+ 5
~ swim ~ it's in C.
Thank you so much @~ swim ~
+ 1
We cannot take address in function as arguments in C. It will obviously throw an error.