jweinst1
9/11/2016 - 10:54 PM

bit set example for cpp

bit set example for cpp

#include <iostream>
#include <bitset>

//good example with bitsets

int main()
{
	std::bitset<5> f;
	f.set(0, 1);
	f.set(1, 1);
	std::cout << f << std::endl;
	//00011
	std::cout << f[0] << std::endl;
	//1
}