So say I had:
public: static void print(string message) { }
Is there a way I could make it accept other data types (eg. int, double etc) in the same function?
So I could call it like print(7) and it would work?
Thanks everyone for the answers; in the title I wanted it as the same function because I didn't realise functions could have the same names as each other (like variables). Hence, I thought the only way you could do it was through the same function. As I am quite new to C++, I preferred the method of just using the same function name and doing it with different parameters (the overloading method).