C/C++支持的常量表示形式
在Visual C++ 6.0中测试了一下,C/C++支持哪些常量表示形式。下面就是我实验的例程。欢迎大家给出改进意见。
- #include <stdio.h>
- int main()
- {
- 1;
- 1l;1L;
- 1u;1U;
- 1ul;1uL;1Ul;1UL;1lu;1lU;1Lu;1LU;
- -1;
- -1l;-1L;
- -1u;-1U;
- -1ul;-1uL;-1Ul;-1UL;-1lu;-1lU;-1Lu;-1LU;
- 01;
- 01l;01L;
- 01u;01U;
- 01ul;01uL;01Ul;01UL;
- 01lu;01lU;01Lu;01LU;
- -01;
- -01l;-01L;
- -01u;-01U;
- -01ul;-01uL;-01Ul;-01UL;
- -01lu;-01lU;-01Lu;-01LU;
- 0x1;
- 0x1l;0x1L;
- 0x1u;0x1U;
- 0x1ul;0x1uL;0x1Ul;0x1UL;0x1lu;0x1lU;0x1Lu;0x1LU;
- 0X1;
- 0X1l;0X1L;
- 0X1u;0X1U;
- 0X1ul;0X1uL;0X1Ul;0X1UL;0X1lu;0X1lU;0X1Lu;0X1LU;
- -0x1;
- -0x1l;-0x1L;
- -0x1u;-0x1U;
- -0x1ul;-0x1uL;-0x1Ul;-0x1UL;-0x1lu;-0x1lU;-0x1Lu;-0x1LU;
- -0X1;
- -0X1l;-0X1L;
- -0X1u;-0X1U;
- -0X1ul;-0X1uL;-0X1Ul;-0X1UL;-0X1lu;-0X1lU;-0X1Lu;-0X1LU;
- 0xa;0xA;0XA;0Xa;
- 1.0;
- 1.0f;1.0F;1.f;1.F;1.0l;1.0L;1.l;1.L;
- 01.f;
- 09.f;
- '1';
- "1";
- true;
- false;
- return 0;
- }
相关推荐
文山羊 2020-11-07
susmote 2020-11-07
拉斯厄尔高福 2020-11-04
xceman 2020-10-23
hellojunz 2020-10-23
caojhuangy 2020-10-12
xinyupan 2020-09-28
lousir 2020-09-27
一个逗逗 2020-09-22
Maryhuan 2020-09-20
rkhstar 2020-09-09
DreamSnow 2020-09-09
aehousmantao 2020-09-03
tkernel 2020-09-03
abfdada 2020-08-26
svap 2020-08-25
二十不悔三十而立 2020-08-19
FlightForever 2020-08-17
joyjoy0 2020-08-13