首页
/
每日頭條
/
教育
/
c語言int占幾個字節
c語言int占幾個字節
更新时间:2025-12-25 15:32:28

  int所占的字節數是根據要運行的系統架構決定的,編譯器決定了程序要輸出的對應架構,對于不同的架構,int占的字節數不同。

  1、16位編譯器

  char :1個字節

  char*(即指針變量): 2個字節

  short int : 2個字節

  int: 2個字節

  unsigned int : 2個字節

  float: 4個字節

  double: 8個字節

  long: 4個字節

  long long: 8個字節

  unsigned long: 4個字節

  2、32位編譯器

  char :1個字節

  char*: 4個字節

  short int : 2個字節

  int: 4個字節

  unsigned int : 4個字節

  float: 4個字節

  double: 8個字節

  long: 4個字節

  long long: 8個字節

  unsigned long: 4個字節

Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2025 - www.tftnews.com All Rights Reserved