Does printf function in c calls argument by reference or by value?
3 Answers
Everything in C is passed by value.
Even things that look like they're passed by reference (i.e., pointers to variables so that you can change the underlying variables) are in fact the values of the pointers being passed by value.
2 Comments
Umesha MS
hi paxdiablo, let us consider we are passing the variable argument to a function in C++ then will they be passed by value or reference?
paxdiablo
@Umesha, C++ has proper reference types, I believe. C doesn't have them. If you're talking about passing from C to C++, you're still limited by C's idioms unless you rely on extensions to the language. C itself (as in ISO C) does not cover inter-language stuff.