无符号数
This commit is contained in:
parent
e5373892a1
commit
e9a0cb266e
|
@ -0,0 +1,14 @@
|
||||||
|
// 无符号数
|
||||||
|
#include <iostream>
|
||||||
|
#include <bitset>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
unsigned char a = 255, b = 0, c = 0x30;
|
||||||
|
cout << bitset<8>(a) << "," << dec << (int)a << endl;
|
||||||
|
cout << bitset<8>(b) << "," << dec << (int)b << endl;
|
||||||
|
cout << bitset<8>(c) << "," << dec << (int)c << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue