参数或参数? [英] Arguments or parameters?

查看:29
本文介绍了参数或参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常发现自己对术语参数"和参数"的使用方式感到困惑.它们在编程世界中似乎可以互换使用.

I often find myself confused with how the terms 'arguments' and 'parameters' are used. They seem to be used interchangeably in the programming world.

使用它们的正确约定是什么?

What's the correct convention for their use?

推荐答案

参数是函数定义的作为输入的东西,参数是作为参数传递的东西.

Parameters are the things defined by functions as input, arguments are the things passed as parameters.

void foo(int bar) { ... }

foo(baz);

在本例中,barfoo 的参数.baz 是传递给 foo 的参数.

In this example, bar is a parameter for foo. baz is an argument passed to foo.

这篇关于参数或参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆