| bitset::size |
public member function |
Return size
Returns the number of bits in the bitset.
Parameters
none
Return 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 second.size() is 4
|
See also