agowtham
asked on
Doubt in Typecast
#include <stdio.h>
main()
{
int a;
double b=xxxxxxx.xxxxx;//Some value
a=(int)b;
printf("%d",a);
}
main()
{
int a;
double b=xxxxxxx.xxxxx;//Some value
a=(int)b;
printf("%d",a);
}
What doubt are you having?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually, when a floating type is converted to an integral type, if the value of the integral part cannot be represented by the integral type the behavior is undefined.
Compiler dependent then? Who needs platform dependence!