Code
  • 首页
  • cpu-architecture
  • performance
  • c++
  • branch-prediction
  • java
2023-06-02 05:00:03

“参数”vs“参数”

language-agnosticfunctionargumentsterminologyparameters

我把参数和参数搞混了没有注意什么时候该用一个什么时候该用另一个。

你能告诉我吗?


参数是作为方法签名(方法声明)一部分的变量。参数是调用方法时使用的表达式。

考虑下面的代码:

void Foo(int i, float f)
{
    // Do things
}

void Bar()
{
    int anInt = 1;
    Foo(anInt, 2.0);
}

这里i和f是形参,anInt和2.0是实参。

2009-11-24 09:29:18

推荐文章

  • 数据挖掘中分类和聚类的区别?
  • 如何在PHP中截断字符串最接近于一定数量的字符?
  • 在Swift中如何调用GCD主线程上的参数方法?
  • 主体、使用者和主体之间的意义和区别是什么?
  • 什么是分片,为什么它很重要?
  • 你能解释一下流的概念吗?
  • 存在类型是什么?
  • 编程中的术语“上下文”?
  • 函数应该返回空对象还是空对象?
  • 在c#中引用类型变量的“ref”的用途是什么?
  • 如何以及为什么'a'['toUpperCase']()在JavaScript工作?
  • 如何从Python函数中返回两个值?
  • 关于数据库,每个开发人员应该知道些什么?
  • 哪个HTTP状态代码表示“尚未准备好,稍后再试”?
  • 当内存不足导致抛出OutOfMemoryError时会发生什么?

aliyun

最新文章

  • 如何删除默认的导航栏空间在SwiftUI导航视图
  • 我可以列出所有的标准Go包吗?
  • 证书验证失败:无法获得本地颁发者证书
  • 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
  • 打开同一目录两次
  • 实体框架核心:在上一个操作完成之前,在此上下文中开始的第二个操作
  • NullInjectorError: AngularFirestore没有提供程序
  • 如何为构造函数定制Visual Studio的私有字段生成快捷方式?
  • 从元组/数组值派生联合类型
  • 如何在Angular2中截断文本?
  • 安装tzdata非交互式
  • ionic 2 - Error在Android Studio中找不到Gradle的安装版本
  • 如何查看所有地区所有正在运行的Amazon EC2实例?
  • 当使用pip3安装包时,“Python中的ssl模块不可用”
  • 安装APK时出现错误

标签

cpu-architectureperformancec++branch-predictionjavaundogit-commitgitversion-controlgit-remotegit-pushgit-branchgit-pullgit-fetchpythongeneratoriteratorjsonmime-typescontent-typearraysjavascriptgit-addcode-formattingcstandards-complianceoperatorscommentsdynamic-memory-allocationstackmemory-managementheap-memorylanguage-agnosticoverwritebackground-colorbrowserhtmldomjqueryvisibilityuse-strictsyntaxjslintremote-branchgit-checkoutpython-moduleidiomsprogram-entry-pointnamespacesbranch
2025 code 京ICP备15047053号-1