How C++ Resolves a Function Call
C is a simple language. You’re only allowed to have one function with each name. C++, on the other hand, gives you much more flexibility:
You can have multiple functions with the same name (overloading).
+ and
Namespaces help you avoid naming conflicts.
I like these C++ features. With these features, you can make
str1 + str2 return the concatenation of two strings. You can have a pair of 2D points, and another pair of 3D points, and overload
dot(a, b) to work with either type. You can have a bunch of array-like classes and write a single