I could not understand when we say that C ++ is a strongly typed language, when a float can be assigned to an integer, and when a function that should return a string can also return bool, as follows:
const std::string testfunc()
{
float x =9.0;
int y = x;
return false;
}
int main()
{
std::cout<<testfunc()<<std::endl;
return 0;
}
Can someone enlighten me, what do we mean when we say that C ++ is strongly typed?
Kapil source
share