C語言中各個數據類型的字節大小


這里我通過程序來證明C語言中int,char這樣的數據類型的大小。

 1 #include <stdio.h>
 2 
 3 int main()
 4 {
 5     printf("%d\n",sizeof(char));
 6     printf("%d\n",sizeof(short));
 7     printf("%d\n",sizeof(int));
 8     printf("%d\n",sizeof(long));
 9     printf("%d\n",sizeof(long long));
10     printf("%d\n",sizeof(float));
11     printf("%d\n",sizeof(double));
12     printf("%d\n",sizeof(long double));
13     return 0;
14 }


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM