cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
function output 2
function output 2
Apr 17, 2014 at 11:57pm UTC
stevebrule
(10)
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 );
Apr 18, 2014 at 12:06am UTC
TheIdeasMan
(6817)
Hi,
Why don't you compile it and find out for yourself? Should only take a minute :+)
Topic archived. No new replies allowed.