Any faster way to access bit maps?
I have an array declared in integer and each bit of the array represents an item.
E.g. int Array;
Array is used to represent 64 items.
So if items 1, 5, 32, 33 exists, the bitmap represented by Array is
010001000 00000000 00000000 00000001 10000000 00000000 000000000 00000000
Given Array, I use double for loop to check which items exist
I find that double for loop may not be efficient, do you have more faster way to access the bitmap to check for items?
for (i=0; i<2; i++)
for (j=0; j<(sizeof(usi)*8); j++)
if (Array[i] & (1<<j))
cout << "Item Exist";