当前位置:网站首页>C常量,不能改变
C常量,不能改变
2022-06-12 14:42:00 【腿毛ger】
C语言中常量分为
1 字面常量
2 const修饰的常变量
3 #define 定义的标识符常量
4 枚举常量
//括号中的MALE,FEMALE,SECRET是枚举常量
enum Sex {
MALE,
FEMALE,
SECRET
};
枚举常量的默认是从0开始,依次向下递增1的 即 0 1 2
//字面常量
3.14;//字面常量 1000;//字面常量
//const 修饰的常变量
const float pai = 3.14f; //这里的pai是const修饰的常变量,
在C语言中只是在语法层面限制了变量 pai 不能直接被改变,但是 pai 本质上还是一个变量的,所以叫常变量。
pai = 5.14;//是不能直接修改的!
//#define的标识符常量
#define MAX 100
边栏推荐
- Huawei equipment is configured with H virtual private network
- ADB command (I) record
- 启明云端分享| 通过Matter协议实例演示开关通过matter协议来做到对灯亮灭的控制
- Module yaml error: Unexpected key in data: static_context [line 9 col 3]
- In C language, the main function calls another function, which is understood by assembly code
- Ankai microelectronics rushes to the scientific innovation board: the annual revenue of 500million Xiaomi industry fund is the shareholder
- Sorting out the differences between ABS () and Fabs () in C language
- Basic usage of scanner
- QT realize picture dragging
- Crawler problem set (I) record
猜你喜欢

Tu oses le croire? Il m'a fallu deux jours pour développer un système de gestion.

New technology: efficient self-monitoring visual pre training, local occlusion no longer need to worry!

Perfect ending | detailed explanation of the implementation principle of go Distributed Link Tracking

JS (III) convert ES6 syntax to Es5 syntax

安凯微电子冲刺科创板:年营收5亿 小米产业基金是股东

Introduction to QT reflection mechanism and signal slot mechanism

【OCR】AspriseOCR C# 英文、數字識別(中文不行)

Easygui query the company name in the document

Reverse the encryption parameters of a hot water software

How to package QT program learning records with inno setup
随机推荐
Reverse order of Excel
Introduction to functions (inline functions and function overloading)
Junit测试中常用的断言
PMP agile knowledge points
Getting started with webdriver
Printing colored messages on the console with printf
Unit test (I) unit test with JUnit
【Instant】1. Equivalent to date class 2 Represents a moment
ADSL
[wechat applet] 3 The first wechat applet
Ppt cannot be opened, always prompt how to fix it
掌门教育被强制退市:上市仅一年时间 软银CMC损失惨重
用游戏来讲序列化与反序列化机制
MAT的安装和使用
【MySQL】数据库基本操作
新技术:高效的自监督视觉预训练,局部遮挡再也不用担心!
QT link error: undefined reference to VTable for "XXX“
亿纬锂能拟募资90亿:刘金成骆锦红夫妇合计认购60亿 布局光谷
C secret arts script Chapter 5 (structure) (Section 1)
C secret script Chapter 3 (detailed explanation of string function) (Section 1)