Arrays1 10. Objective-C Arrays 배열 Objective-C에서 배열은 '같은 타입'의 요소들이 '연속적으로 저장'된 '고정된 사이즈'의 자료구조이다.배열의 원소는 연속적인 메모리 공간에 저장되어 있어 index로 접근 가능하며(0이 맨 첫번째) 가장 낮은 주소가 첫 번째 요소, 가장 높은 주소가 마지막 요소를 가리킨다.배열 선언요소의 타입과 배열의 사이즈를 명시적으로 작성해준다.(배열의 사이즈는 0초과의 정수 리터럴이며, 타입은 크게 구애받지 않는다.)type arrayName [arraySize];//declaredouble balance[10];//초기화 해주지 않아서 0이나 쓰레기 값이 들어있다.배열 초기화double balance[5] = {1000.0, 2.0, 3.0, 50.0, 100.0};//사이즈를 생략하면 배열의 요소 개.. 2024. 5. 7. 이전 1 다음