0

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 ?

4
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by zeroliken
0
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.....

0
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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.