C++ Question Compiler warning declaring new VECTOR3?

Topper

Addon Developer
Addon Developer
Donator
Joined
Mar 28, 2008
Messages
671
Reaction score
32
Points
43
Hi,
sorry, but i don't understand the compilerwarning from VC++ 2002 on this line:
static VECTOR3 *pt_PosData = new VECTOR3[MaxObjects];

I get the warning:

Warning, converting from double to unsigned int ...

Can i ignore these warning?
Or is there a better way to write it?

I can see no bug by using it...
 
What's the type of MaxObjects?
 
Uuuuups, it was double looool :thumbup:
thx....
 
Switch your declaration of MaxObjects from:

double MaxObjects;

...to:

unsigned int MaxObjects;

No sense in having a fractional part of an object counter. :) The warning is occurring because the compiler is dropping the fractional portion of MaxObjects on that line.
 
Back
Top