Hey people,
I am a newbie to C++. I have learn from the books
that C++ has strong type checking, but when I tried out a small program below and compiled with
MS-Visual C++ 6.0, it raise no warning or error?
Can anyone explain why? Thanx
#include <iostream.h>
int main()
{
int a;
char b;
cout<<"size of a: "<<sizeof(a)<<endl;
cout<<"size of b: "<<sizeof(b)<<endl;
a = 10;
b = 105; //why OK with integer 105 instead of a
//character as b = 'H', no compiler //warning here???
cout<<a<<" and "<<b;
cout<<a + b; //Confuse??? why int + char is //OK, no error???no warning??
return 0;
}