This commit is contained in:
2026-02-24 07:39:30 +08:00
parent fae2ab8977
commit 397c928058
2 changed files with 22 additions and 0 deletions

20
sizeof关键字函数.cpp Normal file
View File

@@ -0,0 +1,20 @@
//
// Created by viole on 2026/2/20.
//
#include "iostream"
#include "windows.h"
using namespace std;
int main() {
SetConsoleOutputCP(CP_UTF8);
short age = 21;
int num1 = 21;
long num2 = 32;
long long num3 = 42;
cout<<"short的大小是"<<sizeof(age)<<endl;
cout<<"int"<<sizeof(num1)<<endl;
cout<<"long的大小是"<<sizeof(num2)<<endl;
cout<<"long long的大小是"<<sizeof(num3)<<endl;
cout<<sizeof(2178787)<<endl;
cout<<sizeof("nkljkjkj")<<endl;
u_int num4 = 42;
}