Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 61ac477

Browse files
Create C++_STL_Bitset.cpp
1 parent d954ebe commit 61ac477

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

‎Bitset/C++_STL_Bitset.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
#define MAX 10
5+
bitset<MAX> bs;
6+
int main() {
7+
cout<<bs<<endl; //will print the entire bitset
8+
bs[0]=1; //O(1) access to each boolean value , indexing starts from least significant bit/rightmost bit
9+
cout<<bs<<endl;
10+
return 0;
11+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /