What could be the problem? It doesn’t matter which number I choose for str, it is always 2681561585988519419914804999641169225495873164118478675544712288744352806014709395360374859633380685538006371637297210170750776562389313989286729
char *str = "2.6"; printf("%f\n", strtof(str, (char**)NULL));
whole program:
#include <stdio.h> #include <string.h> #include <stdlib.h> int main(int argc, char *argv[]) { char *str = "2.6"; printf("%f\n", strtof(str, NULL)); return 1; }
using -wall:
test4.c:7: warning: implicit declaration of function âstrtofâ
source share