기본 콘텐츠로 건너뛰기

C++ 자료형 범위

형식 이름바이트기타 이름값의 범위
int4signed–2,147,483,648 ~ 2,147,483,647(2^31)
unsigned int4unsigned0 ~ 4,294,967,295
__int81char-128 ~ 127
unsigned __int81unsigned char0 ~ 255
__int162short, short int 및 signed short int–32,768 ~ 32,767
unsigned __int162unsigned short, unsigned short int0 ~ 65,535
__int324signed, signed int 및 int–2,147,483,648 ~ 2,147,483,647
unsigned __int324unsigned, unsigned int0 ~ 4,294,967,295
__int648long long, signed long long–9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807
unsigned __int648unsigned long long0 ~ 18,446,744,073,709,551,615
bool1없음false 또는 true
char1없음–128~127(기본값)

 /J를 사용하여 컴파일된 경우 0~255
signed char1없음-128 ~ 127
unsigned char1없음0 ~ 255
short2short int, signed short int–32,768 ~ 32,767
unsigned short2unsigned short int0 ~ 65,535
long4long int, signed long int–2,147,483,648 ~ 2,147,483,647
unsigned long4unsigned long int0 ~ 4,294,967,295
long long8없음(그러나 __int64와 동일)–9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807
unsigned long long8없음(그러나 unsigned __int64와 동일)0 ~ 18,446,744,073,709,551,615
enumvaries없음이 문서의 뒷부분에서 설명 참조
float4없음3.4E+/-38(7개의 자릿수)
double8없음1.7E+/-308(15개의 자릿수)
long doubledouble과 동일없음double과 동일
wchar_t2__wchar_t0 ~ 65,535

댓글

이 블로그의 인기 게시물

Tree traversal의 3가지

1. 전위 순회 (Preorder Traversal) Root -> Left Tree -> Right Tree   ( 루트를 제일 처음에 방문 ) 2. 중위 순회 (Inorder Traversal) Left Tree -> Root -> Right Tree   ( 루트를 중간에 방문 ) 3. 후위 순회 (Postorder Traversal) Left Tree -> Right Tree -> Root   ( 루트를 제일 마지막에 방문 ) <소스코드> 출처 : http://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder /// C program for different tree traversals #include <stdio.h> #include <stdlib.h> /* A binary tree node has data, pointer to left child    and a pointer to right child */ struct node {      int data;      struct node* left;      struct node* right; }; /* Helper function that allocates a new node with the    given data and NULL left and right pointers. */ struct node* newNode(int data) {      struct node* node = (struct node*)                 ...