return by referencethe return value of the


Return by reference:

The return value of the function must be an address variable.  In following program the

function returns the value of x or y and their types are declared as reference variable.

 

int &f_ref(int &c, int &d); // int &f_ref(int, int) is invalid for reference variable void main( )

{int a, b,c;

c=f_ref(a, b);

}

int &f_ref(int &x, int &y)

{if x>y return x; else return y;

}

 

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: return by referencethe return value of the
Reference No:- TGS0161127

Expected delivery within 24 Hours