Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

printf function in c

Tags:

c

printf

Does printf function in c calls argument by reference or by value?

like image 704
Balaji Avatar asked Dec 07 '10 06:12

Balaji


2 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.

like image 118
paxdiablo Avatar answered Sep 28 '22 06:09

paxdiablo


There's no pass by reference in C, everything is by value or pointer-to-address by value

like image 29
Andreas Wong Avatar answered Sep 28 '22 07:09

Andreas Wong