#include<bits/stdc++.h>using namespace std;int main(){unsigned int a=10; printf("%x\n", a) ;a=~a;bitset <32> x ;x=a;cout<<x.to_string();printf("\n%x\n", a) ;printf("%d\n", a) ;printf("%u\n", a) ; a=0;printf("%x\n", a) ;a=~a;bitset <32> x ;x=a;cout<<x.to_string();printf("\n%x\n", a) ;printf("%d\n", a) ;printf("%u\n", a) ;}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:22:13: error: redeclaration of ‘std::bitset<32ul> x’ bitset <32> x ; ^ prog.cpp:9:13: note: ‘std::bitset<32ul> x’ previously declared here bitset <32> x ; ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!