Functions can take several argument but they can return only one value.
You can return a container object or something similar which contains more values.
C++0x will have tuple which can contain multiple values of different types
Because of array "x" is created on stack! And it seems to work properly but the returned array "x" is released memory area in my opinion. In addition if you refer this area latter you can get a pretty crash.
void set_argument_to_5 ( int &number )
{
number = 5;
}
int main()
{
int x = 2;
// x == 2
set_argument_to_5 ( x ); // the parameter 'number' is a reference so all the changes that affect 'number' in the function body, will affect 'x' as well
// x == 5
}