Sunday, February 28, 2010

Programmer - C++: Compiler warning for large unsigned int

Programmer Question

I have following array, that I need to operate by hand on bitmaps.



const unsigned int BITS[32] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 
2048, 4096, 8192, 16384, 32768, 65536, 131072,
262144, 524288, 1048576, 2097152, 4194304,
8388608, 16777216, 33554432, 67108864, 134217728,
268435456, 536870912, 1073741824, 2147483648};


Unfortunately, when compiled I get




warning: this decimal constant is unsigned only in ISO C90




How can I remove this?



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails