C++ function overloading class

Can anyone link me to a basic example or show me what this is. I think I get it, It is combining class and using the overload function to make the same class with the same name do different things. This is what I am thinking. Any example would be awesome.
overloading just means 2 functions (part of a class or not) that have the same name but different argument types.

1
2
3
4
5
6
class foo
{
   public:
   void print(string &s) {cout <<"string: " << s << endl;}
   void print(int &i)      {cout <<"int: " << i << endl;}
};


both named print, see? ^^
Last edited on
I see I see. I thought so. Thanks for clearing this up for meh.
Topic archived. No new replies allowed.