parameters aren't the same as variables?

13th Oct 2016, 11:06 AM
Barak Tubul
Barak Tubul - avatar
2 Answers
+ 3
No. When calling a function, it can take values/objects as input, those are called the parameters (or arguments) of the function. They are indicated between parenthesis after the function name in the function declaration. For example, the function void func(int a, int b) takes 2 integer parameters, which are assigned to variables a and b inside the function when calling it.
13th Oct 2016, 11:43 AM
Zen - avatar
Zen covers it excellently, no more to be said here.
13th Oct 2016, 11:26 PM
Liam Keegan
Liam Keegan - avatar