zoukankan      html  css  js  c++  java
  • Parameter和Argument的区别

    看《TIJ》时老看到“引数”这个词,觉得怪别扭的,但一直没去查引数和参数有何区别,先查资料终于明白了:
    1.http://blog.chinaunix.net/u/25073/showart_188475.html
    一般说来,两个是可以互换的。但是 C 程序员的习惯是:parameter 是参数,而 argument 是参数的值。也就是说,函数原型的参数列表,是 parameter list,比如

    int sum(int a, int b);

    而当使用的时候

    int sum;
    sum = sum(10, 20);

    10 和 20 则是 argument。

    这个习惯也影响了很多其他语言的程序员。如果要混合两者的意义,一般用 argument,而 parameter 则比较少用。

    argument 有的时候也被称作 actual parameter。

    对应的中文术语是

    parameter = 形参 (估计是「形式参数」简称)
    argument = 实参 (估计是「实际参数」简称) 

    2.http://royfang.spaces.live.com/blog/cns!53F57C7F0CE9D52C!125.entry
    argument和parameter是有区别的,过去的资料中统一翻译为参数是不准确的,前者翻译成引数,后者翻译成参数,这样的翻译才是精确的翻译,两者的区别如下文:
    What is the difference between an argument and a parameter?
    引数和参数有何区别?
    While defining method, variables passed in the method are called parameters. 
    当定义方法时,传递到方法中的变量称为参数.
    While using those methods, values passed to those variables are called arguments. 
    当使用方法时,传给变量的值称为引数.

     

  • 相关阅读:
    空矩形星星排列图源程序
    点名源程序
    计数器
    按键
    游戏石头剪刀布
    PCB自动生成总图和子图
    对于电脑中文件的一些处理
    一般电脑软件整体缩进和缩退快捷键
    java从小到大循环打印
    STM(WIFI模块)
  • 原文地址:https://www.cnblogs.com/wkun/p/4255530.html
Copyright © 2011-2022 走看看