Float and int variabels in the same function?

Nov 11, 2012 at 11:09pm
Hi,
I currently workning on a school assingment where we shall create a function that can convert both int and float numbers (celsius to fahrenheit). But I can't figure out how to create a function that can apply on both variabel types?

cheers!
Nov 11, 2012 at 11:40pm
You can use function overloading.

Look about halfway down this page: http://www.cplusplus.com/doc/tutorial/functions2/
Nov 11, 2012 at 11:46pm
Last edited on Nov 11, 2012 at 11:48pm
Nov 12, 2012 at 8:55pm
Thanx, that solved it =)
Topic archived. No new replies allowed.