Need help in polymorphism .

My Teacher want me to Write MAX function in C++ that takes two integer parameters and returns the greater one. then by using polymorphism rewrite it again to take two character parameters and a third time that takes two float parameters. I know how to do the Max function part but i never took polymorphism before if anyone can write this program for me real quick i would really appreciate it .
This is not polymorphism. What you want is called Function Overloading. Polymorphism has to do with class inheritance hierarchies and virtual member functions and is-a relationships, etc.
Are you sure the teacher said polymorphism?

maybe he/she meant FUNCTION OVERLOADING (which is also known as STATIC POLYMORPHISM)

can you check??
sorry for the late response but I'm sure he said polymorphism maybe he is wrong because he is suppose to be a java teacher and programming teachers aren't that good in egypt anyways .
i think it's the static polymorphism i just checked the assignment again
In that case, all you have to do is make sure the functions have the same name and you should know the rest. Give it a try ;)
i never took C++ before i only studied C and Basic and now Java if u could type the program for me real fast i will appreciate it
Read http://www.cplusplus.com/doc/tutorial/functions2/ , section "Overloaded functions". We don't write homeworks for others.
If you know C, the only thing you have to know about function overloading in C++ is that the functions have the same name and are differentiated by the number and/or types of the parameters they take.
okey thanks guys i will try to do it alone
This video help me a lot to understand function overloading(static polymorphism
http://www.youtube.com/watch?v=f1FZiyGuAsM
Topic archived. No new replies allowed.