Hi guys ,
In Visual Studio 2005 I compiled the following code
int main()
{
float a;
a=0.1;
if(a<0.1)
{
printf("C\n");
}
else
{
printf("C++\n");
}
}
I was very surprised when I saw the output C++ .
I got the warning C4305 :" '=' : truncation from 'double' to 'float' " , I searched the web but couldn't find some answers .
I don't understand what's wrong with assigning the value 0.1 to a float variable .
Thank you