In article <da23fd45-4729-4a98-8a99-
b9ef4dd8800a@l28g2000prd.googlegroups.com>,
amphetaman@gmail.com says...
> I know this might seem kind of silly, but is it necessary to cast int
> to double?
>
> Do I have to do
>
> int i = 42;
> double d = static_cast<double>(i);
>
> or can I just do d = i?
The language allows you to do the assignment without an explicit type
cast. Somewhere, I suppose there might be a compiler that warns you
about doing it, but that's a bit hard to guess -- someday I might create
a web site of "inane compiler warnings", but I haven't yet...
--
Later,
Jerry.
The universe is a figment of its own imagination.