Hi Can anyone please help me understand and so possibly illustrate with an example why and how a function cant return or evaluate more than one value ?
Hi Can anyone please help me understand and so possibly illustrate with an example why and how a function cant return or evaluate more than one value ?
int something(int a,int b, int c)
{
int d;
\\does something
return d;
}
How is this function called????
int z;
z=something(a,b,c);
So how can you assign two returned value to one variable???
Makes sense???
So a function cannot return two values.....
int something(int a,int b, int c) { int d; \\does something return d; }
How is this function called????
int z; z=something(a,b,c);
So how can you assign two returned value to one variable???
Makes sense???
So a function cannot return two values.....
A function can return a value :/
Note the term "void" in a function means it doesnt return a variable but everything else does e.g. bool functionhere() can return a value either true or false
This can easily be answered with a wee bit of google search
and the first result answered the question precisely
http://www.cplusplus.com/doc/tutorial/functions/