0

Is there a way to carryout explicit data type convertions automatically? if the complier can see your errors why can't it correct them?

4
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by alc6379
0

Because if it does that it would be guessing (do you want a guessing compiler?)

It can't always be sure what you mean, so it doesn't know what to correct them based on.

0

What if it converted floats over to ints automatically? What would it do with the fractions?

scru makes an excellent point. When you're working with a type-safe language, one of the key points is that the compiler is going to be VERY picky about making sure types match up.

Personally, I wouldn't even use the explicit conversion unless I absolutely had a good reason...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.