当前位置:网站首页>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.
边栏推荐
- hr竟主动给这位测试小姐姐涨工资,她是怎么做到的?
- The article is on the list. Welcome to learn
- H5 canvas drawing circle drawing fillet [detailed explanation]
- Essais de pénétration - sujets d'autorisation
- Detailed summary of position positioning
- Could not find “store“ in the context of “Connect(homePage)
- Penetration test - directory traversal vulnerability
- Kotlin compose perfect todo project surface rendering background and shadow
- How to install the blue lake plug-in to support Photoshop CC 2017
- 电子协会 C语言 1级 28 、字符菱形
猜你喜欢

Svg code snippet of loading animation

Flex flexible layout for mobile terminal page production

Route parameters to jump to the page and transfer parameters -- > hidden parameter list

dotnet-exec 0.4.0 released

DOM document object model (I)

SQL lab range explanation

Array and simple function encapsulation cases

Ctfhub eggs

Activereportsjs V3.0 comes on stage

Baidu ueeditor set toolbar initial value
随机推荐
CUDA compilation error
Understand JS high-order function and write a high-order function
A brief talk on media inquiry
Two dimensional array and function call cases of C language
There is 404 in the laravel visit, except the home page is redirected; Index php
Small sample learning data set
PHP uses JWT
Laravel Vonage SMS sending
TeeChart Pro ActiveX 2022.1
Laravel's little knowledge
buuctf web
Wechat applet new version prompt update
Penetration information collection steps (simplified version)
Basic bit operation symbols of C language
C style string
Dynamic programming Backpack - 01 Backpack
CSRF (Cross Site Request Forgery) &ssrf (server request forgery) (IV)
Eyeshot 2022 Released
Native JS high risk reminder pop-up code snippet, "are you sure you want to do this?" and "it cannot be recovered after deletion. Do you want to continue“
CTFHub-rce