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

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

问题描述

我经常发现自己混淆与所使用的术语论据和参数怎样。他们似乎是在编程世界互换使用。

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);

在这个例子中,的参数。 巴兹是传递给的参数。

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

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

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