在Visual c++6.0中int、short、long型各占多少字节?
Visual c++6.0中int、short、long型所占用字节情况如下:
short 2字节
int 4字节
long 4字节
其实可以用sizeof()运算符求出变量所占字节数的,非常准确。
参考资料:C程序设计(清华大学出版社)