function output 2

Would myint be 40 and my float be 4.8?
Come up with anything different?

Consider the function definition

void Demo( int& intVal,
float floatVal )
{
intVal = intVal * 2;
floatVal = float ( intVal ) + 3.5;
}

Suppose that the caller has variables myInt and myFloat whose values are 20 and 4.8, respectively. What are the values of myInt and myFloat after return from the following function call?

Demo( myInt, myFloat );
Hi,

Why don't you compile it and find out for yourself? Should only take a minute :+)
Topic archived. No new replies allowed.