I have a C background. I was just wondering why was function overloading added to C++? C doesn\'t have function overloading but C++ does, what was the need for it?
What
You could get the answer straight from the horse's mouth: The Design and Evolution of C++ by Bjarne Stroustrup devotes an entire chapter to overloading, its history, evolution, design tradeoffs and decisions.
I won't recount the story here, but will mention a couple of interesting historical facts:
overload
) that had to be used to declare an identifier as overloaded;lint
on a C program for the first time -- somewhat embarrassing".)