d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > A Little Fuzzy Still. > Parameters Vs. Arguments.
Prev12
Add Reply New Topic New Poll
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Apr 16 2014 05:36pm
Quote (NinjaSushi2 @ Apr 16 2014 06:23pm)
So a parameter defines the type/name/etc, while an argument is the value passed in.

edit: I know for isn't a function.


Paramters are declared during function definition. Arguments are passed during function invocation.


Code
//function foo has one parameter
int foo(int bar);

int arg = 5;

//invoking foo requires one argument
int i = foo(arg);


Member
Posts: 35,456
Joined: Jan 25 2009
Gold: 1,173.00
Apr 16 2014 06:12pm
Quote (Minkomonster @ 16 Apr 2014 18:36)
Paramters are declared during function definition. Arguments are passed during function invocation.


Code
//function foo has one parameter
int foo(int bar);

int arg = 5;

//invoking foo requires one argument
int i = foo(arg);


That makes sense.
Go Back To Programming & Development Topic List
Prev12
Add Reply New Topic New Poll