当前位置:网站首页>C constant, cannot be changed
C constant, cannot be changed
2022-06-12 14:51:00 【Leg hair Ger】
C In language, constants are divided into
1 Literal constants
2 const Modified constant variable
3 #define Defined identifier constant
4 Enumeration constants
// In brackets MALE,FEMALE,SECRET It's an enumeration constant
enum Sex {
MALE,
FEMALE,
SECRET
};
The default of enumeration constants is from 0 Start , Increase in descending order 1 Of namely 0 1 2
// Literal constants
3.14;// Literal constants 1000;// Literal constants
//const Modified constant variable
const float pai = 3.14f; // there pai yes const Modified constant variable ,
stay C In language, variables are limited only at the grammatical level pai Can't be changed directly , however pai Is essentially a variable , So it's called a constant variable .
pai = 5.14;// It can't be modified directly !
//#define The identifier constant for
#define MAX 100
边栏推荐
- Common assertions in JUnit testing
- 我愿称之为史上最全的深度学习面经总结(附答案详解)
- Mobileone: the mobile terminal only needs 1ms of high-performance backbone. You deserve it!
- 启明智显分享| 2.8寸手持中控屏应用方案
- New technology: efficient self-monitoring visual pre training, local occlusion no longer need to worry!
- 左对齐,右对齐,随机数,goto,比较输出bool
- 关于互联网大厂裁员
- Thinking: what is asynchrony and thread safety
- Array one
- Data collection
猜你喜欢
[Writeup]BUU SQL COURSE1[入门级]
Assertion of selenium webdriver
Serialization and deserialization mechanism in terms of games
Getting started with webdriver
启明云端分享| 通过Matter协议实例演示开关通过matter协议来做到对灯亮灭的控制
阿里建议所有 POJO 类属性使用包装类,但这些坑你有注意到吗?
函数递归示例
数组相关内容
Configuring OSPF pseudo connection for Huawei devices
C scanf函数
随机推荐
Array one
ADSL
【Optional】1. Map and ifpresent 2 Ofnullable and orelse
USART(RS232422485)、I2C、SPI、CAN、USB总线
用游戏来讲序列化与反序列化机制
函数相关事项
Huawei equipment configuration BGP as number replacement
你敢信?开发一个管理系统我只用了两天
程序构造和解释之过程抽象
Interview (XI) futu written test questions
Leader education was forced to be delisted: Softbank CMC suffered heavy losses only one year after listing
Dataset and dataframe in sparksql
sql跨库注入
Can you believe it? It took me only two days to develop a management system
Xshell (I) is missing mfc110u DLL file resolution
[ROC] aspriseocr C # English, Digital identification (not Chinese)
C secret arts script Chapter 5 (paragraph) (Section 3)
Easygui query the company name in the document
Variable parameters
C secret script Chapter 1: data storage (in-depth analysis) supplement