I've heard casts have to be avoided as much as possible, and can always be avoided. But SOME functions seem to require them. EG:
void main()
{
int nr;
nr = strlen("Babe Ruth");
cout<< nr;
}
That way, I get: warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data.
But when I change the offender into:
I get: warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data.
So I'm asking: Can anyone, including Bill Gates, fix this so it doesn't spit warnings OR require typecasts?