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
softweb avatar
softweb
2
 
#include <stdio.h>
 
void funzione(char param){
    printf("%d",(int)param);
}
 
int main(void){
    float n=7.5f;
    funzione(n);
    return 0;
}
 
(Beware of overflow errors)
7 answers - 7 questions
+ 1  Positive        Negative

AiTuX avatar
AiTuX
0
1 answers - 0 questions
  Positive        Negative



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)