当前位置:网站首页>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
边栏推荐
- Ali suggests that all POJO attributes use wrapper classes, but have you noticed these pits?
- 模块八
- C常量,不能改变
- JD scanning code to obtain cookies
- [system. Currenttimemillis()] current timestamp: the number of milliseconds that have elapsed since the current system time was 0:00:00 on January 1, 1970
- [SPARK][CORE] 面试问题之谈一谈Push-based shuffle
- selenium进阶
- 能链智电登陆纳斯达克:贝恩是股东 成中国充电服务第一股
- MAT的安装和使用
- Leader education was forced to be delisted: Softbank CMC suffered heavy losses only one year after listing
猜你喜欢
随机推荐
工业机械臂(机器人)视觉定位引导系统
Soft test (VI) Chrome browser installation selenium IDE
[OCR] aspriseocr C # English, number recognition (not Chinese)
数组相关内容
C secret arts script Chapter 5 (paragraph) (Section 3)
[datetmeformatter] realize the conversion between localdatetime and text
C secret arts script Chapter 2 (detailed explanation of pointers) (Section 3)
JS (II) syntaxerror: cannot use import statement outside a module
Variable parameters
Common assertions in JUnit testing
Huawei equipment configuration BGP as number replacement
浏览器指纹解读
Tensorrt based in-depth learning model deployment practice tutorial!
Crawler problem set (I) record
Autofac (2)
[wp][beginner level] attack and defense world game
函数递归示例
【Instant】1. Equivalent to date class 2 Represents a moment
Ali suggests that all POJO attributes use wrapper classes, but have you noticed these pits?
JUnit exception, a method that asserts that the exception information is not empty









