a method of passing arguments to a function that


A: Method of passing arguments to a function that takes parameter of type reference.

 for instance:

void swap( int & x, int & y )

{

int temp = x;

x = y;

y = temp;

}

int a=2, b=3;

swap( a, b );

Essentially, inside the function there won't be any copy of arguments "y" and "x" instead they refer to original variables a & b. thus no extra memory required to pass arguments and it is more efficient.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: a method of passing arguments to a function that
Reference No:- TGS0218245

Expected delivery within 24 Hours