当前位置:网站首页>[embedded C foundation] Part 3: constants and variables
[embedded C foundation] Part 3: constants and variables
2022-07-28 13:01:00 【Black cat senior】
1 Constant
Constant : It is not allowed to change the quantity into a constant
1.1 Integer constant
Decimal constant 100
Octal constant 0100( Octal constants are expressed in 0 start )
Hexadecimal constant 0x100
100L 100l Long integer 100
100UL 100ul Unsigned long 100
int a = 100L;(long int Type is also 4 byte )
1.2 Floating point constants
3.1415
3.1415e15( namely 3.1415 multiply 10 Of 15 Power )
3.1415e-15
3.1415E15
3.1415E-15
1.3 character constants
‘a’
‘A’
’ ’ Space character
‘\0’ \0 character
‘\n’ A newline
‘\t’ Horizontal tabs
‘\r’ enter
‘\b’ backspace operator
‘\v’ Vertical tabs
‘\a’ Ring the bell
‘\’ \ Symbol
‘’’ ' Symbol
‘"’ " Symbol
Escape character
C In language , A character can be used in addition to its entity ( That is, the real character ) Express , It can also be represented by coded values . This way of using encoded values to indirectly represent characters is called escape characters (Escape Character).
Escape characters to \ perhaps \x start , With \ The beginning represents the encoded value followed by octal form , With \x The beginning represents the encoded value followed by hexadecimal form . For escape characters , Only octal or hexadecimal can be used .
character 1、2、3、a、b、c Corresponding ASCII The octal forms of the codes are 61、62、63、141、
边栏推荐
- Pits encountered in MSP430 development (to be continued)
- How to open the power saving mode of win11 system computer
- Understanding of vite2
- 05 pyechars basic chart (example code + effect diagram)
- Cloud native - runtime environment
- Phpstudy steps to quickly build a website (teach you to build it by hand)
- Science heavyweight: AI design protein has made another breakthrough, and it can design specific functional proteins
- 企业数字化本质
- Change the document type in endnode and import it in word
- [graduation design] oscilloscope design and Implementation Based on STM32 - single chip microcomputer Internet of things
猜你喜欢

机器学习基础-决策树-12

How to open the power saving mode of win11 system computer

Linear classifier (ccf20200901)

Sliding Window

【嵌入式C基础】第6篇:超详细的常用的输入输出函数讲解

Cloud native - runtime environment

Machine learning practice - decision tree-22

Summary: golang's ide:vscode usage

Code layered management of interface testing based on RF framework

Machine learning practice - neural network-21
随机推荐
What if win11 cannot recognize Ethernet
归并排序
【C语言易错点】第4篇:结构体在内存中存储规则详讲
子线程更新UI全解
Summary: golang's ide:vscode usage
Scala transformation, filtering, grouping, sorting
Quick read in
Phpstudy steps to quickly build a website (teach you to build it by hand)
MySQL is always installed unsuccessfully. Just do it like this
Which big model is better? Openbmb releases bmlist to give you the answer!
Leetcode394 string decoding
C# 泛型是什么、泛型缓存、泛型约束
Can molecular modeling solve the data dilemma of AI pharmacy?
Leetcode remove element & move zero
机器学习实战-决策树-22
2020-12-13
Machine learning Basics - decision tree-12
How to add PDF virtual printer in win11
STM32F103 several special pins are used as ordinary io. Precautions and data loss of backup register 1,2
Datanode data block missing problem finding