Help with this for loop

In the 1st loop the arguments (nCount, nCount & 3). What does the & 3 do or mean?


Storage8<bool> cBoolStorage;
for(int nCount = 0; nCount < 10; nCount++)
cBoolStorage.Set(nCount, nCount & 3);

for(int nCount = 0; nCount < 10; nCount++)
cout <<(cBoolStorage.Get(nCount) ? "true" : "false") << endl;
> What does the nCount & 3 do or mean?
It is a bitwise operation.

http://www.cprogramming.com/tutorial/bitwise_operators.html
Topic archived. No new replies allowed.