当前位置:网站首页>【嵌入式C基础】第3篇:常量和变量
【嵌入式C基础】第3篇:常量和变量
2022-07-28 11:53:00 【黑猫学长呀】
1 常量
常量:不允许被改变的量成为常量
1.1 整形常量
十进制常量 100
八进制常量 0100(八进制常量以0开头)
十六进制常量 0x100
100L 100l 长整型的100
100UL 100ul 无符号长整型100
int a = 100L;(long int型也为4字节)
1.2 浮点型常量
3.1415
3.1415e15(即3.1415乘以10的15次方)
3.1415e-15
3.1415E15
3.1415E-15
1.3 字符常量
‘a’
‘A’
’ ’ 空格字符
‘\0’ \0字符
‘\n’ 换行符
‘\t’ 横向制表符
‘\r’ 回车
‘\b’ backspace符
‘\v’ 纵向制表符
‘\a’ 响铃
‘\’ \符号
‘’’ '符号
‘"’ "符号
转义字符
C 语言中,一个字符除了可以用它的实体(也就是真正的字符)表示,还可以用编码值表示。这种使用编码值来间接地表示字符的方式称为转义字符(Escape Character)。
转义字符以\或者\x 开头,以\开头表示后跟八进制形式的编码值,以\x 开头表示后跟十六进制形式的编码值。对于转义字符来说,只能使用八进制或者十六进制。
字符 1、2、3、a、b、c 对应的 ASCII 码的八进制形式分别是 61、62、63、141、
边栏推荐
- Machine learning Basics - decision tree-12
- 机器学习基础-集成学习-13
- 【嵌入式C基础】第5篇:原码/反码/补码
- SuperMap iclient3d for webgl to realize floating thermal map
- Machine learning practice - decision tree-22
- 05 pyechars 基本图表(示例代码+效果图)
- 十三. 实战——常用依赖的作用
- Insufficient permission to pull server code through Jenkins and other precautions
- Cloud native - runtime environment
- leetcode 376. Wiggle Subsequence
猜你喜欢

云原生—运行时环境

Cloud native - runtime environment
![[July 5 event preview] Flink Summit](/img/d8/a367c26b51d9dbaf53bf4fe2a13917.png)
[July 5 event preview] Flink Summit

Merge sort
![[graduation design teaching] ultrasonic ranging system based on single chip microcomputer - Internet of things embedded stm32](/img/27/58fd175753b21dc21bd2d950cf5f15.png)
[graduation design teaching] ultrasonic ranging system based on single chip microcomputer - Internet of things embedded stm32

VS code更新后不在原来位置

Low code: reduce technical capability requirements and improve software development efficiency

Initialization examples of several modes of mma8452q

01 pyechars 特性、版本、安装介绍

单调栈Monotonic Stack
随机推荐
面试必问,敲重点!讲一下 Android Application 启动流程及其源码?
Siemens docking Leuze BPS_ 304i notes
Summary: golang's ide:vscode usage
[pictures and texts] detailed tutorial of one click reinstallation of win11 system
Cloud native - runtime environment
Jetpack 全家桶之 LiveData 使用及源码篇
Ccf201912-2 recycling station site selection
MySQL总是安装不成功,这样处理就好啦
Leetcode394 string decoding
力扣315计算右侧小于当前元素的个数
Datanode data block missing problem finding
01 introduction to pyechars features, version and installation
LeetCode206 反转链表
MMA8452Q几种模式的初始化实例
机器学习实战-神经网络-21
合并表格行---三层for循环遍历数据
Installation and reinstallation of win11 system graphic version tutorial
Machine learning practice - neural network-21
01 pyechars 特性、版本、安装介绍
C structure use