return type
Title
Question
During function overloading ,
Why the return type of the functions(that are overloaded) must be same?
in other books we had read that
overloading functions should have
1) same name(functions should exist in same class)
2)either the parameter type should be different or the no. of parameters should be different .
NOTHING ABOUT FUNCTIONS RETURN TYPE.
Why the return type of the functions(that are overloaded) must be same?
in other books we had read that
overloading functions should have
1) same name(functions should exist in same class)
2)either the parameter type should be different or the no. of parameters should be different .
NOTHING ABOUT FUNCTIONS RETURN TYPE.
Advanced-Cpp Function-Overloading-And-Overriding 07-08 min 0-10 sec
Answers:
In the tutorial it is mentioned that the return type is same in function overriding,
and not function overloading.
Hi,
Kindly go through the tutorial again.
It is mentioned that, in function overloading the arguments and the data-type of the arguments will be different.
And in function overriding the return-type is same.
Kindly go through the tutorial again.
It is mentioned that, in function overloading the arguments and the data-type of the arguments will be different.
And in function overriding the return-type is same.
Login to add comment