Formal Parameter vs Actual Parameter
Formal Parameter: 形参
Actual Parameter: 实参
The term parameter (sometimes called formal parameter) is often used to refer to the variable as found in the function definition, whileargument (sometimes called actual parameter) refers to the actual value passed. To avoid confusion, it is common to view a parameter as a variable, and an argument as a value.
Parameter & Pointer
Why we use Pointer as parameter: http://stackoverflow.com/questions/7054662/why-do-certain-c-c-functions-use-pointers-as-parameters
Simple Swapping function: http://www.cs.utsa.edu/~wagner/CS2213/swap/swap.html
本文详细阐述了函数中的形参与实参的区别,包括内存分配、值传递、参数数量、类型和顺序一致性,以及参数与指针在C/C++中的应用。重点解释了为何某些C/C++函数使用指针作为参数,并通过实例演示了如何实现简单交换功能。
576

被折叠的 条评论
为什么被折叠?



