Advertisement

how do I get rid of the following warnings?

Started by March 18, 2002 01:28 PM
1 comment, last by da_cobra 22 years, 7 months ago
warning C4244: ''argument'' : conversion from ''float'' to ''int'', possible loss of data source :


SetRect(&src, 16, 0, (16+paddle.iWidth), 16) ;

 
paddle.iWidth is the float I know that I can just ignore those warnings and I can change how VC++ display what kind of warnings he ignores but is there another way to get rid of this warning by changing my code a bit? thanx in advance
Use an explicit cast like this.

SetRect(&src, 16, 0, (int)(16+paddle.iWidth), 16) ;

Landskencht
My sig used to be, "God was my co-pilot but we crashed in the mountains and I had to eat him..."
But folks whinned and I had to change it.
Advertisement
thanx that was the thing I was looking for

This topic is closed to new replies.

Advertisement