基本資料型別的sizeof

2021-05-02 06:40:22 字數 570 閱讀 2843

測試**:

#include

using

namespace std;

int main()

x86平台的執行結果:

sizeof(char) =

1sizeof(unsigned

char) =

1sizeof(short

int) =

2sizeof(unsigned

short

int) =

2sizeof(int) =

4sizeof(unsigned

int) =

4sizeof(long

int) =

4sizeof(unsigned

long

int) =

4sizeof(float) =

4sizeof(double) =

8sizeof(long

double) =

12

[email protected]

>

基本資料型別

列舉 定義列舉型別 enum season 定義兩個列舉變數 enum season mylove yourlove 為兩個列舉變數賦值 yourlove fall mylove winter 把列舉值當成無符號整數執行輸出 nslog fall 的值 u fall 3 nslog winter 的...

基本資料型別

建立資料庫 create database database name 顯示所有資料庫 show databases 選擇使用那個資料庫 use database name 刪除資料庫 drop database database name 檢視自己mysql資料庫支援什麼儲存引擎 show eng...

基本資料型別

整型int 整數,在目前絕大多數機器上佔4個位元組。tc環境中是2個位元組 單精度實型float 單精度浮點數,一般是4個位元組長 雙精度實型double 雙精度浮點數,一般是8個位元組長 字元型char 字元,一般是1個位元組長 用來表示256個ascii字元,或者0 255的整數 列舉型enum...