메뉴 바로가기

서브메뉴 바로가기

본문 바로가기

logo

C/C++/MFC
일반
2013.03.26 17:49

Visual Studio - Data Type Ranges

(*.192.212.181) 조회 수 3093 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

Microsoft Visual C++ recognizes the types shown in the table below.

Type NameBytesOther NamesRange of Values
int*signed, 
signed int
System dependent
unsigned int*unsignedSystem dependent
__int81char, 
signed char
–128 to 127
__int162short, 
short int, 
signed short int
–32,768 to 32,767
__int324signed, 
signed int
–2,147,483,648 to 2,147,483,647
__int648none–9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
bool1nonefalse or true
char1signed char–128 to 127
unsigned char1none0 to 255
short2short int, 
signed short int
–32,768 to 32,767
unsigned short2unsigned short int0 to 65,535
long4long int, 
signed long int
–2,147,483,648 to 2,147,483,647
long long8none (but equivalent to __int64)–9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
unsigned long4unsigned long int0 to 4,294,967,295
enum*noneSame as int
float4none3.4E +/- 38 (7 digits)
double8none1.7E +/- 308 (15 digits)
long doublesame as doublenonesame as double
wchar_t2__wchar_t0 to 65,535

 

A variable of __wchar_t designates a wide-character or multibyte character type. By default wchar_t is a typedef for unsigned short. Use the L prefix before a character or string constant to designate the wide-character-type constant. When compiling with /Zc:wchar_t or /Za, the compiler can distinguish between an unsigned short and wchar_t for function overload purposes.

Signed and unsigned are modifiers that can be used with any integral type except bool. The char type is signed by default, but you can specify /J (compiler option) to make it unsigned by default.

The int and unsigned int types have the size of the system word: four bytes. However, portable code should not depend on the size of int.

Microsoft C/C++ also features support for sized integer types. See __int8, __int16, __int32, __int64 for more information. Also see Integer Limits.



관련 문서가 검색되었습니다.
  1. [2013/05/16] Tool palette bar, OrCAD Capture for Windows by WhiteAT (5440)
  2. [2012/03/13] STM32F103xx 시리즈 토글 최대 스피드 - 18Mhz by WhiteAT (8534)