变量类型大小 & 变量名规则

This commit is contained in:
flykhan 2023-06-15 14:19:08 +08:00
parent 3935d097c8
commit 48b67927c5
2 changed files with 23 additions and 0 deletions

10
day4/d3.cpp Normal file
View File

@ -0,0 +1,10 @@
#include <iostream>
using namespace std;
int main()
{
int $123 = 10;
cout << $123 << endl;
return 0;
}

13
day4/d4.cpp Normal file
View File

@ -0,0 +1,13 @@
#include <iostream>
using namespace std;
int main()
{
int n; // 定义变量时, 默认初始化值为 0
// cout << "n = " << n << endl;
// '\t' 转义字符, 表示为 <Tab> 制表符, 一般情况下, 一个制表符占 4 个空格
cout << n << "\t data type is " << sizeof(n) << endl;
return 0;
}