Jump to content

A simple definition clarification.

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
T121AD

T121AD

    Newbie

  • Members
  • Pip
  • 2 posts
Hi,
I just have a quick question regarding the terms PARAMETERS and ARGUMENTS. I know that one of them is referred to the variables when you are making a class/function and the other is referred to the variables when you are calling that function. I just don't know which is which. I tried looking it up but I couldn't find a clear distinction between the two.
Thanks in advance

Ken.

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
If you search google for "argument vs parameter" you actually get linked to the same question I previously asked which never received a great answer. So I decided to look it up in my class notes.

Generally the terms are used interchangeably. However, parameters are declared in the function/method header. Arguments are the values you pass to the function/method when you call it.

function nameOfFunction(int x) {
//code
}
x is the parameter.

nameOfFunction(5)
5 is the argument.

#3
T121AD

T121AD

    Newbie

  • Members
  • Pip
  • 2 posts
I should have thought to search for that. But nevertheless, thank you very much for the clarification.