Arguments or parameters?

Peanut picture Peanut · Jan 9, 2009 · Viewed 26.7k times · Source

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?

Answer

Mehrdad Afshari picture Mehrdad Afshari · Jan 9, 2009

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.