Quote (AbDuCt @ Jul 21 2012 01:26am)
you need to define the type of variables you are passing (the variables inside the brackets) as well the return type (the type before the function name)
once you define the variables inside the brackets you do not have to declared them inside your function.
ex:
Code
int total(int x, int y, int z)
{
return x + y + z;
}
takes the integers passed to it and returns an integer values based upon them.
Quote (carteblanche @ Jul 21 2012 01:27am)
would help if you specified the language, bud
I'm guessing that won't even compile. when you pass them as arguments, your function treats them as local variables. you probably have to specify the quantity and types/names, depending on what language you use
Ahh, I see. Thanks guys, prof didn't really explain this.
This post was edited by Eep on Jul 21 2012 12:33am