Passing by reference in c
How do I pass by reference in C? (not C++)
I know in c++ I just add a & in front of the variable name but it seems not to be the case with c.
thanks
void aFunction (int *aNumber) { *aNumber += 25*5;}int x = 50;aFunction (&x);printf("The number is %d ." x);
that''s the best you can in C.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement