cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Float and int variabels in the same func
Float and int variabels in the same function?
Nov 11, 2012 at 11:09pm UTC
alext
(18)
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 UTC
Branflakes91093
(207)
You can use function overloading.
Look about halfway down this page:
http://www.cplusplus.com/doc/tutorial/functions2/
Nov 11, 2012 at 11:46pm UTC
Darkmaster
(564)
maybe this helps you:
http://www.cplusplus.com/doc/tutorial/templates/
Last edited on
Nov 11, 2012 at 11:48pm UTC
Nov 12, 2012 at 8:55pm UTC
alext
(18)
Thanx, that solved it =)
Topic archived. No new replies allowed.