Hi All
I need to fill a float pointer with the float value returned by atof:
atof returns a float not a float*. Is there a way to do this without doingCode:#include <stdio.h> #include <string.h> #include <stdlib.h> int main(void) { float *f = (float *)atof("12.13") ; printf("input is %f\n", *f) ; }
I guess I prefer a one-liner!Code:float dum = atof("12.13") ; float *f = &dum ;
thnx
LuCa