c++如何檢視位元組
位元組在電腦科學領域,位元組指的是8位記憶體單元,常用byte/B表示,是度量計算機儲存空間大小的度量單位。我們說的1KB就是1024個位元組,即1024*8位。
在C++裡,位元組定義稍有不同。一個位元組包含的位數可表示的狀態(例如8位可表示的狀態是256種)應足以覆蓋基本字符集(ASCII)字元的個數。通常的C++實現中使用的字元系統是ASCII,所以在通常C++實現中,一個位元組就是8位。但是在一些採用Unicode字元系統的C++實現中,可能使用16位或者32位位元組。
#include<iostream>
#include <limits>
using namespace std
int main()
{
cout << "type: tt" << "************size**************"<< endl
cout << "bool: tt" << "所佔位元組數:" << sizeof(bool)
cout << "t最大值:" << (numeric_limits<bool>::max)()
cout << "tt最小值:" << (numeric_limits<bool>::min)() << endl
cout << "char: tt" << "所佔位元組數:" << sizeof(char)
cout << "t最大值:" << (numeric_limits<char>::max)()
cout << "tt最小值:" << (numeric_limits<char>::min)() << endl
cout << "signed char: t" << "所佔位元組數:" << sizeof(signed char)
cout << "t最大值:" << (numeric_limits<signed char>::max)()
cout << "tt最小值:" << (numeric_limits<signed char>::min)() << endl
cout << "unsigned char: t" << "所佔位元組數:" << sizeof(unsigned char)
cout << "t最大值:" << (numeric_limits<unsigned char>::max)()
cout << "tt最小值:" << (numeric_limits<unsigned char>::min)() << endl
cout << "wchar_t: t" << "所佔位元組數:" << sizeof(wchar_t)
cout << "t最大值:" << (numeric_limits<wchar_t>::max)()
cout << "tt最小值:" << (numeric_limits<wchar_t>::min)() << endl
cout << "short: tt" << "所佔位元組數:" << sizeof(short)
cout << "t最大值:" << (numeric_limits<short>::max)()
cout << "tt最小值:" << (numeric_limits<short>::min)() << endl
cout << "int: tt" << "所佔位元組數:" << sizeof(int)
cout << "t最大值:" << (numeric_limits<int>::max)()
cout << "t最小值:" << (numeric_limits<int>::min)() << endl
cout << "unsigned: t" << "所佔位元組數:" << sizeof(unsigned)
cout << "t最大值:" << (numeric_limits<unsigned>::max)()
cout << "t最小值:" << (numeric_limits<unsigned>::min)() << endl
cout << "long: tt" << "所佔位元組數:" << sizeof(long)
cout << "t最大值:" << (numeric_limits<long>::max)()
cout << "t最小值:" << (numeric_limits<long>::min)() << endl
cout << "unsigned long: t" << "所佔位元組數:" << sizeof(unsigned long)
cout << "t最大值:" << (numeric_limits<unsigned long>::max)()
cout << "t最小值:" << (numeric_limits<unsigned long>::min)() << endl
cout << "double: t" << "所佔位元組數:" << sizeof(double)
cout << "t最大值:" << (numeric_limits<double>::max)()
cout << "t最小值:" << (numeric_limits<double>::min)() << endl
cout << "long double: t" << "所佔位元組數:" << sizeof(long double)
cout << "t最大值:" << (numeric_limits<long double>::max)()
cout << "t最小值:" << (numeric_limits<long double>::min)() << endl
cout << "float: tt" << "所佔位元組數:" << sizeof(float)
cout << "t最大值:" << (numeric_limits<float>::max)()
cout << "t最小值:" << (numeric_limits<float>::min)() << endl
cout << "size_t: t" << "所佔位元組數:" << sizeof(size_t)
cout << "t最大值:" << (numeric_limits<size_t>::max)()
cout << "t最小值:" << (numeric_limits<size_t>::min)() << endl
cout << "string: t" << "所佔位元組數:" << sizeof(string) << endl
// << "t最大值:" << (numeric_limits<string>::max)() << "t最小值:" << (numeric_limits<string>::min)() << endl
cout << "type: tt" << "************size**************"<< endl
return 0
-
上海話吃餛飩什麼意思
上海話吃餛飩的原話是,瞎子吃餛飩心知肚明。所以上海話吃餛飩指的就是,你在某件事上裝傻,其實心裡面是一清二楚的啦。...
-
黎明的經典歌曲有哪些
sugarinthemarmalade真的愛情定可到未來一夜傾情我的另一半 你令愛了不起 讓愛隨你走 愛比我重要對不起, 我愛你  我的真心獻給你第十《我這樣愛你》是韓劇《我心蕩漾》的主題曲第九《我的親愛》原唱是日本歌手槇原敬之,日文版叫《已不...
-
許願卡怎麼寫
可以這樣寫:1、祝全家平平安安,健康幸福。父母親戚財源滾滾,事業有成!2、希望今年學習進步,身邊的人每天都過得快樂!身體健康,心想事成!3、命運讓我們走到同一天空下,一起追逐,一起成長,一起歡笑……無數個縱情歡樂的白天,無數個推心置腹的夜晚,無數個絢爛而單純的時刻……...
-
Cade是什麼意思
Cade常見英文名音譯是卡德,凱德。Cade意思是溫柔,他就是這樣,常見於男生英文名。來源於宿務語、威爾士語,Cade是個冷門的名字,這個英文名字表示實際、務實、謹慎。,Cade音標為[keɪd],英文名整體來說“Cade”長度為4,精練、響亮大氣,給男性起名是指很心地善良,負責任、以...