Can function outputs be overloaded? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can function outputs be overloaded?

12th Mar 2017, 9:24 PM
Ivan
3 Answers
+ 6
C# have output parameters, I am not entirely sure if C++ has that since I dont use those. Also, you cant have create 2 variable with names anyway
12th Mar 2017, 10:25 PM
Wen Qin
Wen Qin - avatar
+ 5
As long as you also change at least one parameter (or add or remove), you can do it. Example: int sum(int x, int y) -> our normal function which returns an int. double sum(double x, double y) -> overloaded function which returns a double and takes two double parameters instead of two ints.
12th Mar 2017, 10:53 PM
Alper Tiryakioğlu
Alper Tiryakioğlu - avatar
0
I remeber a lesson in sololearn, where it says that outputs cannot be overloaded
13th Mar 2017, 8:16 PM
Ivan