C 基本資料型別

2021-09-06 10:51:35 字數 1117 閱讀 7449

c++基本資料型別

型別識別符號

型別說明

長度

值域範圍

型別識別符號

型別說明

長度

值域範圍

char

字元型1

-128 ~ 127

int整型

2 or 4

-2147483648 ~ 2147483647

float

單精度實型

41.18*10-38 ~ 3.40*1038

double

雙精度實型

82.23*10-308 ~ 1.79*10308

void

無值域0

0signed char

有符號字元型

1-128 ~ 127

unsigned char

無符號字元型

10 ~ 255

short int

短整型2

-32768 ~ 32767

signed short int

有符號短整型

2-32768 ~ 32767

unsigned short int

無符號短整型

20 ~ 65535

signed int

有符號整型

2 or 4

unsigned int

無符號整型

2 or 4

long int

長整型4

-2147483648 ~ 2147483647

signed long int

有符號長整型

4-2147483648 ~ 2147483647

unsigned long int

無符號長整型

40 ~ 4294967295

long double

實型(長雙精度)

103.37*10-4932 ~ 1.18*104932

C 基本資料型別

型別識別符號 型別說明 長度 位元組 範圍備註 char字元型 1 128 127 27 27 1 unsigned char無符字元型 10 255 0 28 1 short int短整型 2 32768 32767 2 15 215 1 unsigned short int無符短整型 20 65...

C 基本資料型別

1.基本資料型別 程式中的變數都是先定義,後使用的。對變數的定義,可以包括三個方面 資料型別 儲存型別 作用域。所謂資料型別是按被定義變數的性質,表示形式,佔據儲存空間的多少,構造特點來劃分的。在c語言中,資料型別可分為 基本資料型別 構造資料型別,指標型別 空型別。基本型別 整型 字元型 實型 浮...

C 基本資料型別

型別別名位 允許的值 sbyte system.sbyte 8在 128 127 之間的整數 byte system.byte 8在 0 255 之間的整數 short system.int16 16在 32 768 32 767 之間的整數 ushort system.uint16 16在 0 6...