通过引用传递给c ---- help banfa [英] pass by reference in c----help banfa
本文介绍了通过引用传递给c ---- help banfa的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi.Does C支持通过引用传递还是仅通过值传递?如果我们传递变量的地址并使用指针将其带入函数定义中,那么它是否会通过引用传递?感谢您的帮助。 />
Jerico
Hi.Does C support pass by reference or only pass by value?If we pass the address of a variable and take it in the function definition with a pointer, then will it be pass by reference?Thanks for help.
Jerico
推荐答案
Hi.Does C支持通过引用或仅通过引用传递传递值?如果我们传递变量的地址并使用指针将其带入函数定义中,那么它是否会通过引用传递?感谢您的帮助。
Jerico
Hi.Does C support pass by reference or only pass by value?If we pass the address of a variable and take it in the function definition with a pointer, then will it be pass by reference?Thanks for help.
Jerico
C支持通过引用传递和传递值。在C中,被调用函数中的相应参数必须声明为指针类型。
这是一个示例程序
C supports both pass by reference and pass by value. In C, the corresponding parameter in the called function must be declared as a pointer type.
Here is a sample program
展开 < span class =codeDivider> | 选择 | Wrap | Line数字
C支持按引用传递和传递值。在C中,被调用函数中的相应参数必须声明为指针类型。
这是一个示例程序
C supports both pass by reference and pass by value. In C, the corresponding parameter in the called function must be declared as a pointer type.
Here is a sample program
展开 < span class =codeDivider> | 选择 | Wrap | Line数字
在上面的代码中,C仍然按值传递,但现在它正在模拟传递引用
我想,这就是你想要的???
In the above code, C is still passing by value, but now it is simulating pass-by-reference
I think, this is what you wanted???
这篇关于通过引用传递给c ---- help banfa的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文