C language–custom types: structures, enumerations, unions (1)

Table of Contents 1 structure 1.1 Basic knowledge of structure 1.2 Declaration of structure 1.3 Special Statement 1.4 Self-reference of structures 1.5 Definition and initialization of structure variables 1.6 Structure memory alignment 1.6.1 Structure alignment rules 1.6.2 Why structures need to be aligned 1.7 Modify the default alignment number 1.8 Structure parameter passing 2. bit […]

[C language] Custom types: unions and enumerations

Foreword There are three types of custom types: structures, unions, and enumerations. We have already explained structures in the last blog, and next we will learn about unions and enumerations. Article directory 1. Consortium 1.1 Statement of the Consortium 1.2 Union members in memory 1.3 Calculation of the size of the consortium 1.4 Compare the […]

Custom types: unions and enumerations

Union type Declaration method: union Un, can have multiple members of different types, Alias: Community Features: 1. All members of the consortium share a block of memory space //Declaration of union type union Un { char c; int i; }; int main() { union Un un = {0}; printf(“%p\ “, & amp;(un.i)); printf(“%p\ “, & […]

Explanation of custom types: structures, enumerations, unions

Key points of this chapter: 1: Structure Declaration of structure type Self-reference of structure Definition and initialization of structure variables Structure memory alignment Structure parameter passing Structure implements bit segments (filling of bit segments & portability) 2: Enumeration Definition of enumeration types Advantages of enumerations Use of enumerations 3: Union Definition of union types Features […]

C language structures and unions

C language structure Concept of structure In C language, you can set up a data type structure composed of different types of data. This combined data structure is a structure. Understand the code based on the video: Video introducing structures Structure Case Video: Case Reference article: Introduction to structures #include<stdio.h> #include<stdlib.h> #include<string.h> //strcut tells the […]

Oracle table joins (inner joins, outer joins (left joins, right joins), implicit joins, table unions, table intersections, table complements)

Oracle table join, inner join, outer join (left join, right join, full join), implicit join, table union, table intersection, table complement 1. Inner join inner join 1.The difference between and and where 2. Inner association implicit writing method (Oracle proprietary) 3. Cross connection–Cartesian product connection in conclusion: 2. Outer connection 1. left join left join […]

[C language] Structure memory alignment, bit segments, enumerations, unions

After learning about structures before, have you ever been confused about the size of a structure? ? In fact, there will be memory alignment when the structure is stored in the memory. Let’s talk about bit segments, enumerations, and unions. Let’s learn with Xiao Zhang. Structure memory alignment Alignment rules for structures: The first member […]

Custom types (structs, enumerations, unions, bit fields)

Directory 1. Structure 1. Declaration of structure Special statement 2. Self-reference of structure 3. Definition and initialization of structure variables 4. Structure memory alignment Structure alignment rules: Unnested structure: Nested structure: Modify the default alignment number 5. Structure parameter passing 6. Bit segment Understanding of bit segments Memory allocation of bit segments Cross-platform problems of […]

Memory size of custom types (structs, bit fields, enumerations, unions)

Directory 1. Calculation structure memory alignment method 1.1 Why does alignment exist? 1.2 Alignment example 2. Bit segment memory 2.1 bit segment 2. Memory allocation for 2-bit segments 3. Enumeration type 3.1 Meaning of enumeration 3.2 Changes in enumeration meanings 4.Consortium (Commonwealth) 4.1 Consortium Statement 4.2 Consortium size 1. Calculation structure memory alignment method 1. […]