Hey, can anybody tell me a simple definition of parameters and prototypes when dealing with functions? Thanks
prototype is the stmt that describes about the function to the compiler..
ex: float divide(int,float);
this prototype describes that divide() is a function that will be defined later , also it
returns float as return type and it will hold two parameters of int and float type..
so that when compiler encounter some stmt as
int a= divide(10,50.5);
it generates appropriate action..
about parameters:
it is the arguments we are passing to the function.. here (int,float) are parameter types.. and 10,50.5 are the actual parameters..
it shld follow the same order and datatype specified in the prototype..
while defining the function,
float divide(int a,float b)
{
return a/b;
}
here a and b are called dummy parameter or some other name they specify.. go thro the net and learn more..