2.3 整數資料型態

整數型態的差別:位元數與範圍

不同整數型態佔用的位元數不同,導致能表示的數值範圍不同。

常見整數型態

型態 位元數 位元組 範圍
short 16 2 -32,768 ~ 32,767
int 32 4 -2,147,483,648 ~ 2,147,483,647
long long 64 8 -9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807

Log in to read the full content

The syntax book is free for every AACPOJ account. Signing up takes a minute.