Mail Archives: djgpp/1996/11/20/12:17:38
Martin Gumucio wrote:
> int auks;
> auks = 19.99 + 11.99;
...
> utypomv.cpp: In function `int main()':
> utypomv.cpp:10: warning: assignment to `int' from `double'
This is a perfectly legitimate _warning_. It is a warning, after all, not
an error. gcc is warning you that you are doing something which looks
suspicious and has a correspondent loss of significance.
> it simply refuses to make me use type casting of any form.
I suspect you're mistaken. Try
auks = (int) (19.99 + 11.99).
This means, "add 19.99 and 11.99 (both doubles). Then, after you've
computing the result, cast it to an int. Then assign it to `auks', which
is a variable of type int."
--
Erik Max Francis | max AT alcyone DOT com
Alcyone Systems | http://www.alcyone.com/max/
San Jose, California | 37 20 07 N 121 53 38 W
&tSftDotIotE | R^4: the 4th R is respect
"But since when can wounded eyes see | If we weren't who we were"
- Raw text -