C++ 에서의 자료형의 크기는 컴파일러에 따라 좌우된다고 알고 있었다.

틀린 내용은 아니였지만.. 정확하지는 않았다.

아래 링크에서 정확한 내용을 알 수 있었다.

정확하게는… 크기는 정해져 있지 않지만, C++ 표준에서 지정하는 최소 사이즈가 있다는 것이다.

The C++ standard does not specify the size of integral types in bytes, but it specifies minimum ranges they must be able to hold. You can infer minimum size in bits from the required range and the value of CHAR_BIT macro, that defines the number of bits in a byte (in all but the most obscure platforms it’s 8).

출처 : http://stackoverflow.com/questions/589575/size-of-int-long-etc

Tags: , , ,

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.