How can i cast a char to float?
posted by web10 on 2009-06-23 00:00:00
Hello,
Is it possibile to do a cast from char to float in C?
Thanks
Is it possibile to do a cast from char to float in C?
Thanks

2
#include <stdio.h> void funzione(char param){ printf("%d",(int)param); } int main(void){ float n=7.5f; funzione(n); return 0; }

0
Try with the "atof" function: http://www.cplusplus.com/reference/clibrary/cstdlib/atof/
;)
;)
Answer the question
Top Users
- dail (12)
- livin52 (3)
- camu (3)
- softweb (2)
- Nadine (1)
- Josware (1)
- lfelipecr (1)
- gregoriohc (1)
- Mitu (1)
- ryan714 (1)