C语言:parameter和argument的区别

31 篇文章 4 订阅
本文解释了编程中参数(如parameter,formalargument)与实参(如argument,actualargument)的区别,强调了在函数定义和调用时它们的角色,援引了《TheCProgrammingLanguage》中的例子。
摘要由CSDN通过智能技术生成

        很多同学对这两个单词相信不会陌生。两单词的字面意思都是“参数”,可能有些同学就被搞昏头了,其实parameter和argument是有区别的。

以下做简单说明。
1、parameter是指函数定义中参数,而argument指的是函数调用时的实际参数。
2、简略描述为:parameter=形参(formal parameter), argument=实参(actual parameter)。
3、在不很严格的情况下,二者可以混用,一般用argument,而parameter则比较少用。

While defining method, variables passed in the method are called parameters.
当定义方法时,传递到方法中的变量称为参数.

While using those methods, values passed to those variables are called arguments.
当调用方法时,传给变量的值称为引数.(有时argument被翻译为“引数“)

参考

《The C Programming Language》 K&R Page25
    We will generally use parameter for a variable named in the parenthesized list in a function definition, and argument for the value used in a call of function. The terms formal argument and actual argument are sometimes used for the same distinction.

译文:

 我们通常用parameter表示函数定义中括号内的变量名,用argument表示函数调用中使用的值。formal argument和actual argument有时也有相同的区分。

结论如下:

    parameter / formal argument : 形参;

    argument  / actual argument : 实参。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

技术探索者

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值