mirror of
http://106.12.3.193:3000/violeteverisland/learn_cpp.git
synced 2026-03-07 17:17:33 +08:00
1
This commit is contained in:
20
sizeof关键字函数.cpp
Normal file
20
sizeof关键字函数.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user