Float and int variabels in the same func
Float and int variabels in the same function?
Nov 11, 2012 at 11:09pm UTC
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?
Nov 11, 2012 at 11:40pm UTC
You can use function overloading.
Look about halfway down this page:
Nov 11, 2012 at 11:46pm UTC
maybe this helps you:
Last edited on
Nov 11, 2012 at 11:48pm UTC
Nov 12, 2012 at 8:55pm UTC
Thanx, that solved it =)
Topic archived. No new replies allowed.
General C++ Programming
© cplusplus.com, 2000-2017 - All rights reserved -
Spotted an error? contact us