bitset::size | public member function |
size_t size() const; |
Return size
Returns the number of bits in the bitset.
Parameters
noneReturn Value
The number of bits in the bitset. This is the template parameter N.size_t is an unsigned integral type.
Example
// bitset::size #include <iostream> #include <bitset> using namespace std; int main () { bitset<8> first; bitset<4> second; cout << "first.size() is " << (int) first.size() << endl; cout << "second.size() is " << (int) second.size() << endl; return 0; } |
Output:
first.size() is 8 |
See also
bitset::count | Count bits set (public member function) |