Skip to content

Instantly share code, notes, and snippets.

@fortheday
Last active January 27, 2018 10:06
Show Gist options
  • Save fortheday/bd37869fd1db04b9b0f34f98bbac81de to your computer and use it in GitHub Desktop.
Save fortheday/bd37869fd1db04b9b0f34f98bbac81de to your computer and use it in GitHub Desktop.
int *i1 = new int; // 초기화안됨
int *i2 = new int();// 됨
int i3 = int(); // 됨
int i4(0); // 됨
int i5{0}; // 됨
int i6(); // 컴파일에러
cout << *i1 << ' ' << *i2 << ' '<< i3 << ' ' << i4 << ' ' << i5 << endl;
char *pArr1 = new char[10]; // 초기화안함
char *pArr2 = new char[10](); // '\0' 으로 초기화
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment