我有以下數組,我需要手動操作位圖。C++:編譯器警告大unsigned int
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};
不幸的是,在編譯時,我得到
警告:這個小數常量僅ISO C90
是無符號如何刪除這個?
看到這個類似的問題:http://stackoverflow.com/questions/2347936/cant-get-ride-of-this-decimal-constant -is-unsigned-only-in-iso-c90-warning – 2010-02-28 23:33:10
你爲什麼要這樣做?如果你認爲查找表比根據需要計算這些值要快,請再考慮一下...... – Nemo 2011-08-17 05:08:37