int main(void) {
int i = 0;
scanf("%f", &i);
return 0;
}
It is allegedly if I input a float numger, it will collapse.
I have testes it in Gcc4.7, it works.
I hava no VC6.0, so I wanna konw if it will collapse in VC6.0.
If it will, why ? I was told that because the FPU isn’t initialized ?
You want:
instead.
%finscanfexpects an argument of type pointer tofloat. Passing an argument of type pointer tointis undefined behavior.