当前位置:网站首页>C language sorting (to be updated)
C language sorting (to be updated)
2022-07-07 06:17:00 【Wang Xiaoxi WW】
C Language arrangement ( To be updated )
Note: according to CSDN C Language skill tree Organized topic ; The original intention is because C Language vs Java,Python More concise , There are not so many fancy language features , It's perfect for practicing algorithm problems .
List of articles
- C Language arrangement ( To be updated )
- One 、C The development of language
- Two 、 data type
- 3、 ... and 、 Operators and expressions
- Four 、 Statement and control flow
- 5、 ... and 、 Function and program structure
- 6、 ... and 、 Array
- 7、 ... and 、 The pointer
- 8、 ... and 、 character string
- Nine 、 Structure
- Ten 、 Union and enumeration type
- 11、 ... and 、 An operation
- Twelve 、 The preprocessor
- 13、 ... and 、 file
- fourteen 、 Storage management
- 15、 ... and 、 Standard function library
One 、C The development of language
- C Language features
- C Language standards , May refer to C Language standards , ANSI C, ISO C, GNU C
- C Language compilation process ( Preprocessing , compile ( Sink code ), assembly ( Machine code ), link ), May refer to C The compilation process of the language is explained in detail
Two 、 data type
- Variable type , Life cycle and Scope
- Constant 2 Types ( Values and characters ) and Definition (#define and const)
Note: Constants can also be function expressions , such as#define MAX(a,b) ((a > b) ? a : b)
, Reference resources Relational operator ( Judge whether the intervals overlap ) - Data type classification ( Native , The derived , User customization )
Note:- C There is no language bool,string type ; Basic types include Character , floating-point , integer and Empty type ; Derived types include Array , Pointers and functions type ; User defined types include enumeration , Structures and consortia type .
- C++ The basic types of are C Based on the basic types of language , Added bool type .
3、 ... and 、 Operators and expressions
- Assignment operator ( Pay attention to the problem of simultaneous assignment of multiple variables )
- Arithmetic operator (++i < 100 and i++ < 100 The difference between )
- Relational operator
- Logical operators ( Determine if it's a leap year ,|| and && Use )
- The comma operator , Operator priority and evaluation order ( The comma operator ), May refer to C Language comma expression in for Use in loop statements
Note: The comma operator is often used in for Circulation head Initialize or increment Multiple variables- Pay attention to the processing order of variables
- From left to right
- The value of the entire comma expression is the value of the last sub expression .
- sizeof Operator ( Output Space occupied by operands Of Byte size ), May refer to c Language data type byte size and precision
Note:sizeof It looks like a function when used ( Because there is a pair of parentheses after it ), But he is an operator . His usage is as follows 3 Kind of :- a)
sizeof( Variable name )
. - b)
sizeof( Data type name )
. - c)
sizeof Variable name
.
- a)
Four 、 Statement and control flow
- Three numbers are sorted from small to large (swap In situ exchange )
- Judge the type of triangle ( Pay attention to the order of judging conditions )
- switch-case Rating scores
- 99 multiplication table printing (9 That's ok 9 Column )
- greatest common divisor (m) Sum of least common multiple (q)(ab = mq), May refer to Find the greatest common divisor by division
5、 ... and 、 Function and program structure
- Function declaration and definition (C Language Focus on the position of the definition of the method relative to the calling statement )
Note: Actually python Also pay attention to the position of the method definition relative to the calling statement , Just no function declaration , Only function definitions . - Formal parameter and actual parameter ( Be careful swap Time arguments are reference types , Incoming address , Formal parameters are pointer types )
- Print function call sequence (C Language ( compile ) Must pass main Function entry can execute program ,python( explain ) You don't need to )
- Going up the stairs (C Language modular design ), May refer to C Language modular programming
- Internal function (static) And external functions (extern), May refer to C In language static and extern A detailed explanation of the use of ,C Language keywords static And extern Detailed explanation of
Note:- The header file (
.h
) Need to pass#define
and#endif
Define variables and functions - The source file can be divided into multiple
.c
file , Every.c
Files can correspond to one.h
file , The.h
File contains.c
Variable or function declaration of file . - By default, the global variable is with
extern
, That is, in the whole source program all Source file Can be accessed and modified in static
If you modify a global variable , will Hide the global variable from other source files
- The header file (
6、 ... and 、 Array
7、 ... and 、 The pointer
8、 ... and 、 character string
Nine 、 Structure
Ten 、 Union and enumeration type
11、 ... and 、 An operation
Twelve 、 The preprocessor
13、 ... and 、 file
fourteen 、 Storage management
15、 ... and 、 Standard function library
边栏推荐
- 一个简单的代数问题的求解
- Rk3399 platform development series explanation (WiFi) 5.53, hostapd (WiFi AP mode) configuration file description
- [SOC FPGA] custom IP PWM breathing lamp
- Qtthread, one of many methods of QT multithreading
- rt-thread 中对 hardfault 的处理
- [Shell]常用shell命令及测试判断语句总结
- SubGHz, LoRaWAN, NB-IoT, 物联网
- JVM命令之 jstat:查看JVM統計信息
- cf:C. Column Swapping【排序 + 模拟】
- You don't know the complete collection of recruitment slang of Internet companies
猜你喜欢
Go language learning notes - Gorm use - Gorm processing errors | web framework gin (10)
C note 13
3428. Put apples
On the discrimination of "fake death" state of STC single chip microcomputer
Financial risk control practice - decision tree rule mining template
Dc-7 target
生活中的开销,怎么记账合适
SubGHz, LoRaWAN, NB-IoT, 物联网
苹果cms V10模板/MXone Pro自适应影视电影网站模板
软件测试的几个关键步骤,你需要知道
随机推荐
Check point: the core element for enterprises to deploy zero trust network (ztna)
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
软件测试知识储备:关于「登录安全」的基础知识,你了解多少?
云加速,帮助您有效解决攻击问题!
Jstat pour la commande JVM: voir les statistiques JVM
关于STC单片机“假死”状态的判别
Ideas of high concurrency and high traffic seckill scheme
New Year Fireworks code plus copy, are you sure you don't want to have a look
693. Travel sequencing
Oracle迁移中关于大容量表使用数据泵(expdp、impdp)导出导入容易出现的问题和注意事项
蚂蚁庄园安全头盔 7.8蚂蚁庄园答案
You don't know the complete collection of recruitment slang of Internet companies
vim映射大K
【FPGA教程案例14】基于vivado核的FIR滤波器设计与实现
基于ADAU1452的DSP及DAC音频失真分析
【GNN】图解GNN: A gentle introduction(含视频)
Markdown 并排显示图片
JMeter's own functions are not enough? Why don't you develop one yourself
How much do you know about clothing ERP?
DC-7靶机