当前位置:网站首页>2022.1.21 diary
2022.1.21 diary
2022-06-25 05:16:00 【LF19971222】
The global variables of a file are defined as static variables , This means that this variable can only be called by this file . Functions with the same name in other files do not conflict ; However, its application scope is limited .
const The modifier is a read-only variable . It can increase and decrease itself .
int const *a=const int *a
Int *const a;a It's a point int Type const The pointer ,*a It can be rewritten , but a Overwrite not allowed . So this situation must be a=&i; the a initialization .
int const * const a;
a It's a point const int Type const The pointer , therefore *a and a Are not allowed to rewrite .

extern Default statement , Expand the use of variables .
struct: A whole that combines multiple data , Its manifestation is a structure .
Form new data types .
Memory space is allocated to variables , Not assigned to a data type .
struct node
{............
}; The semicolon here should not be forgotten .

C Member operators in languages :. 、→.
Array names cannot be used as group values .

Structural variables cannot be input and output as a whole .
printf(“%d%s%f”,stu1);scanf(“%d%s%f”,&stu1); error !
You can only input and output one by one .

Fixed length initialization
Two square brackets for a two-dimensional array , Only the first one can be empty .

Only short Type , Then account for 2 Byte half word alignment .
Yes int Type , Then account for 4 Byte word alignment .
None of the above , One by one .
Union share ( union ) body : When multiple basic data types or composite data structures occupy the same piece of memory , We're going to use the consortium .
Big_endian Big endian byte order : The high byte bits of the data are stored in the storage unit corresponding to the low address ;
Little_endian Small endian byte order : The low byte bits of the data are stored in the storage unit corresponding to the low address .
Strings are processed with character arrays , There is no concept of byte order .
Enum: Enumeration type
enum The default value of :
Enum kids{nippy,slats,skippy,nina,liz};
enum Specified value of :
Enum levels
{low=100,medium=500,high=2000};
enum Usage of : As switch The label of .
Typedef: yes C Keywords of language , Its purpose is to define a new name for a data type .
Format : typedef data type Custom data types
Define constants and commands ( Avoid magic numbers )
#define MAX 100 Macro name Macrobody
# It starts with preprocessing commands
The preprocessing process is called macro expansion or macro replacement
Simple structure 、 Use a high frequency algorithm to write macro functions .
debugging :
#if 0/1
.....
#endif
Floating point numbers cannot be compared with zero .
Zero of the pointer is null .
Current loop :for、while、do while
C The language doesn't go until the loop
a、b Exchange three ways :
- a=a+b;b=a-b;a=a-b
- a=a^b;b=a^b;a=a^b
- t=a;a=b;b=t
In multiple loops , If possible , The longest loop should be placed on the innermost layer , The shortest cycle is on the outermost layer , In order to reduce CPU The number of times that the cyclic layer is cut across .
If there is logical judgment in the circulatory system , And the number of cycles is very large , The logical judgment should be moved outside the loop body .
goto Use occasion : In multiple nesting , Use when transferring from the innermost to the outermost . In the same function !
An operation :
&: Bitwise AND , The corresponding bits are 1 Only when 1, Otherwise 0
|: Press bit or , The corresponding bits are 0 Only when 0, Otherwise 1
^: Bitwise XOR : When the corresponding bits are the same, it is 0, Different at the same time 1
~: According to the not : Everybody, reverse , That is, the original 1 The bit becomes 0, Originally for 0 The bit becomes 1( It is mainly used to construct a number indirectly , To enhance the portability of the program )
>> Right shift to position : Is the right shift of each bit of the operand , Move out of the low abandon ; High position :(1) For unsigned numbers and positive numbers in signed numbers , repair 0;
(2) A negative number in a signed number , Depends on the system used : repair 0 Of is called “ Logical shift right ”, repair 1 Of is called “ Arithmetic shift right ”. for example ,20>>2=5.
边栏推荐
- The construction and usage of wampserver framework
- Eyeshot Ultimate 2022 Crack By Xacker
- Visual studio 2022 interface beautification tutorial
- Activereportsjs V3.0 comes on stage
- Deeply understand the characteristics of standard flow and off standard elements
- Summary of SQL injection (I)
- Five simple data types of JS
- UVA816 Abbott’s Revenge
- Array: force deduction dichotomy
- Eyeshot 2022 Released
猜你喜欢

《QDebug 2022年6月》

How micro engine uploads remote attachments

MySQL prevents Chinese garbled code and solves the problem of Chinese garbled code

Kotlin compose listens to the soft keyboard and clicks enter to submit the event

Array and simple function encapsulation cases

How to use the Magic pig system reinstallation master

buuctf web

TeeChart Pro ActiveX 2022.1

buuctf(pwn)

Example of dynamic programming 3 leetcode 55
随机推荐
2021-03-23
Creation and use of MySQL index
Use js to simply implement the apply, call and bind methods
Read the general components of antd source code
SRC platform summary
Drag modal box
Bind simulation, key points of interpreting bind handwritten code [details]
Introduction to the hardest core PWN in the whole network_ Graphic analysis
JS verification code input number auto skip
Critical dependency: require function is used in a way in which dependencies
Enhanced paste quill editor
Kotlin compose listens to the soft keyboard and clicks enter to submit the event
How to choose the years of investment in financial products?
Eyeshot Ultimate 2022 Crack By Xacker
Detailed summary of position positioning
Integrate CDN to create the ultimate service experience for customers!
Database overview
In depth understanding of line height and vertical align
File upload vulnerability (III)
A review of small sample learning