The following function mixes call by reference and call by value parameters.

void T ( int & a, int b )
{ 
	int c = a - 1;
	a = c + b;
	b = a + 2;
}

Suppose that in main we had the following:

int apple = 10;
int banana = 20;
T ( apple, banana );

cout << apple << " " << banana;

What is the output?
a) 29 20
b) 10 31
c) 29 20
d) 29 9
e) 10 20

What do you think is the answer? Did you compile and test it for yourself? If not, why not?

It's the same old story - http://www.daniweb.com/forums/thread161400.html
Try it, and find out.

Otherwise, we might just start lying about the answer just to see if you'll believe everything we say, only to find yourself with a crap mark on your assignment.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.