Is it possible to define two functions as given below Justify-00987
This subjective question is related to the book/course vu cs605 Software EngineeringII. It can also be found in vu cs605 Mid Term Solved Past Paper No. 1.
Question 1: Is it possible to define two functions as given below. Justify your answer.
func(int x, int y)
func(int &x, int &y)
func(int x, int y)
func(int &x, int &y)
Answer:
Yes, function can be defined in both given ways, as in function no.1 , function is calling the variable by its value (which is default function call method). In the second function, function call is done by using call by reference methos.