mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-02-03 18:43:52 +08:00
update
This commit is contained in:
19
basic_content/bit/learn.cpp
Normal file
19
basic_content/bit/learn.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include<iostream>
|
||||
|
||||
using namespace std;
|
||||
struct stuff
|
||||
{
|
||||
unsigned int field1: 30;
|
||||
unsigned int : 2;
|
||||
unsigned int field2: 4;
|
||||
unsigned int : 0;
|
||||
unsigned int field3: 3;
|
||||
};
|
||||
int main(){
|
||||
struct stuff s={1,3,5};
|
||||
cout<<s.field1<<endl;
|
||||
cout<<s.field2<<endl;
|
||||
cout<<s.field3<<endl;
|
||||
cout<<sizeof(s)<<endl;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user