为什么scanf函数必须考虑运营商的地址 [英] Why scanf must take the address of operator
本文介绍了为什么scanf函数必须考虑运营商的地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
正如标题所说,我一直想知道为什么 scanf函数
必须以地址
操作符(安培)。
As the title says, I always wonder why scanf
must take the address of
operator (&).
推荐答案
由于C只有传递按值的参数,所以要通过一个变量把一个值,你必须通过它的地址(或一个指针变量)。
Because C only has "pass-by-value" parameters, so to pass a 'variable' to put a value into, you have to pass its address (or a pointer to the variable).
这篇关于为什么scanf函数必须考虑运营商的地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文