bitset - STL C++

operator<<()

Declaration

basic_ostream<XCharType, XTraits>& operator<<(basic_ostream<XCharType, XTraits>& qrOutStream,
                                              const bitset<N>& kqrBits);

Description

This is the overloaded insertion operator for bitsets.

Header Include

#include <bitset>

Example

#include <bitset>
#include <iostream>

int main()
{
	using namespace std;

	// Create a bitset of four bits and output it
	bitset<4> qBits(6);
	cout << "bitset<4>: "<< qBits << endl;

	// Keep the window open
	cin.get();
	return 0;
}

Output

operator<<() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.