M
Mark McIntyre
Hi,
Whenever we type in this code
int main()
{
printf("%f",10);
}
we get an error.
Yes, because the code is broken.
We can remove that by using #pragma directive to
direct that to the 8087.
Don't do that, you're breaking it even worse.
Even after that the output is 0.00000 and not
10.0000. Can anybody tell me why it is like that and why typecasting is
not done in this case??
This has nothing to do with typecasting. You're calling printf() without
any prototype or declaration in scope, so it has no idea what the arguments
mean. You absolutely must declare functions before you use them, typically
by #including the correct header.