I use a byte to store some flag like 10101010, and I would like to know how to verify that a specific bit is at 1 or 0.
10101010
1
0
If you are using C++ and the standard library is allowed, I'd suggest storing your flags in a bitset:
#include //... std::bitset<8> flags(someVariable);
as then you can check and set flags using the [] indexing operator.