본문 바로가기

C++문법

배열의 크기는 sizeof(배열이름)/sizeof(배열자료형)

int arr[81];

cout << sizeof(arr)/sizeof(int) << endl;

 

결과 : 81

'C++문법' 카테고리의 다른 글