问题
Possible Duplicate:
Why scanf must take the address of operator
Why do we pass the variable in the case of printf(), whereas the address of the variable in the case of scanf()? why to pass address in scanf
回答1:
why to use '&' in scanf( ) but not in printf( )
'printf'()' only need the values in order to output them. 'scanf()' stores values, so it needs a place to store them. This is done by providing the addresses (in pointers) of where to store the values.
回答2:
With scanf you want the callee to modify the variable that's why you pass it by reference, if you pass it by value like with scanf you would not have access to the variables address to modify its contents.
来源:https://stackoverflow.com/questions/12102753/address-passing-in-scanf-but-not-in-printf