銆怌璇█杩涢樁绡囥€戜箣鍙橀噺

Posted 灏忓垢杩恇z

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了銆怌璇█杩涢樁绡囥€戜箣鍙橀噺相关的知识,希望对你有一定的参考价值。

鐐瑰嚮涓婃柟鈥滆摑瀛椻€濆叧娉ㄦ垜浠惂
銆怌璇█杩涢樁绡囥€戜箣鍙橀噺
C璇█涓湁鍝簺鍩烘湰绫诲瀷鐨勫彉閲?/span>

char, short, int, long, float, double

銆怌璇█杩涢樁绡囥€戜箣鍙橀噺
鍝簺鍙橀噺鍙互鍔爑nsigned锛?/span>

鍙互鍔狅細char, short, int, long

馃檯鈥嶅彲浠ュ姞锛歠loat, double

銆怌璇█杩涢樁绡囥€戜箣鍙橀噺
鑰冭€冧綘

int *p1; //p1鏄竴涓寚鍚慽nt绫诲瀷鐨勬寚閽?/span>

int const *p4; //p4鍜宲2琛ㄧず鐩稿悓鐨勬剰鎬濓紝鍙槸鍐欐硶涓嶅悓


銆怌璇█杩涢樁绡囥€戜箣鍙橀噺
32浣嶅拰64浣嶅熀鏈暟鎹被鍨嬬殑瀛楄妭闀垮害锛堝吀鍨嬮厤缃級

      

鏁版嵁绫诲瀷

Windows

Linux

32浣?/span>

64浣?/span>

32浣?/span>

64浣?/span>

char

1

1

1

1

short (int)

2

2

2

2

int

4

4

4

4

long   (int)

4

4

4

8

long long

8

8

8

8

float

4

4

4

4

double

8

8

8

8

long   double

8

8

12

16

char*   鎸囬拡绫诲瀷

4

8

4

8

size_t

4

8

4

8

Bool

1

1

1

1

娉細long long鏄疌++鐨?4浣嶆暣鍨嬬殑鍩烘湰绫诲瀷锛屼粠C99寮€濮嬪紩鍏ヨ繖涓蹇碉紝 C++11瀹樻柟姝e紡鏍囧噯濡備笅锛?/span>

long long - target type will have width of at least 64 bits.(since C++11)

銆怌璇█杩涢樁绡囥€戜箣鍙橀噺
灏忕粌涔燼

濡備笅浠g爜鍦?2浣嶇郴缁熶腑鐨勮緭鍑虹粨鏋滄槸锛堬級

void func(char acHello[])

{

printf(鈥?d鈥? sizeof(acHello));

return;

}

void main()

{

char acHello[]=鈥滺ello鈥?

example(acHello);

return;

}

缁撴灉锛?

灏忕粌涔燽

鍦?2浣嶇郴缁熶腑锛屾湁濡備笅浠g爜锛?/span>

char str[] = 鈥漒\\\鈥?

char *p = str;

int n = 100;

鍒檚izeof(str), sizeof(p), sizeof(n)鍒嗗埆鏄灏戯紵

缁撴灉锛? 4 4

琛ュ厖锛歴trlen(鈥淺\\\鈥?=4锛宻izeof(鈥淺\\\鈥?=5锛屼綘鐭ラ亾涓轰粈涔堝悧锛?/span>

鍙橀噺杞崲

int main()

{

     short i = 65535;

     printf("i=%d\n", i);

     return 0;

}

缁撴灉锛?1

銆?span class="mq-337">鍒嗘瀽銆戯細鍥犱负鍐呭瓨涓?5535瀛樺偍鍐呭鐨?6杩涘埗琛ㄧず涓猴細0x0FFFF锛屽皢姝ゅ€间紶閫掔粰16浣嶇殑鍙橀噺i鏃讹紝i鍙兘鎺ュ彈鍒?xFFFF;鐪嬭棣栦綅涓?锛岀紪璇戝櫒浼氳涓篿鏄釜璐熷€硷紝鑷充簬璐熷€肩殑缁濆鍊?婧愮爜鍙栧弽锛?x0000锛?1 = 0x0001銆傚洜姝ゆ渶缁堣緭鍑?1銆?/span>

以上是关于銆怌璇█杩涢樁绡囥€戜箣鍙橀噺的主要内容,如果未能解决你的问题,请参考以下文章

python鍙橀噺

Cygwin瀹夎杩涢樁鈥斺€旈€氳繃ssh鎵撳紑杩滅▼鏈嶅姟鍣℅UI绋嬪簭

绗叓璇?绗簩璁?08_02_bash鑴氭湰缂栫▼涔嬩竷 case璇彞鍙婅剼鏈€夐」杩涢樁

13涓猅ensorflow瀹炶返妗堜緥锛屾暀浣犲叆闂ㄥ埌杩涢樁

java璁剧疆鐜鍙橀噺

Linux 閰嶇疆 jdk mysql 鐜鍙橀噺