I was trying out std::bitset
and after getting wrong results for a while I noticed that the results were in reverse order. Tried searching on cppreference page but couldn't find any source on this and hence need an confirmation. This should be default behaviour across different compilers too?
#include <iostream>
#include <bitset>
using namespace std;
int main() {
bitset<7> bin('C');
cout << bin << endl;
for(int i = 0; i < 7; ++i){ cout << bin[i]; }
return 0;
}
1000011
1100001