Link to home
Start Free TrialLog in
Avatar of agowtham
agowtham

asked on

Doubt in Typecast

#include <stdio.h>
main()
 {
int a;
 double b=xxxxxxx.xxxxx;//Some value
 a=(int)b;
 printf("%d",a);
}

Avatar of ozo
ozo
Flag of United States of America image

What doubt are you having?
ASKER CERTIFIED SOLUTION
Avatar of Aggarwal
Aggarwal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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!