3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by aman rathi
0

The parameters are mapped in the order in which they appear in the argument list. The first parameter on line 11 (a) is mapped to the first parameter on line 3. The second parameter on line 11 (b) is mapped to the second parameter on line 3. That mapping can go on almost indefinitely.

0

In above coding you make the refrence to the both integers a and b, when the function is called from line 11 the control reaches to line 3 to read the definition of function and two thins happen:

1: int &c=a;
2: int &d=b;

It means c is reference variable to a and d to b.
Now any change in c and d will effect change in a and b respectively.

Note: In line no.3 if you avoid use of & operator then change in c and d will not
change in a and b respetively that may be logocal error in programe

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.