






























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!































character string, 2-dim array
한 번에 여러 개의 변수를 생성할 수 있다.
Index 를 통하여 쉽게 자료에 접근할 수 있다.
4
배열을 선언하면서 각 원소의 값을 지정: 배열 초기화(initialization)
다음 문장은 잘못된 문장
배열의 초기화에서 배열 의 크기 생략 가능
int a[4]; a = {10, 30, 40, 50};
Prof. DaeEun Kim
5
int i, sum = 0;
10
11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
문자열의 정의
문자열의 저장
2 차원 문자열 배열 strary 를 이용하여 각 문자열을 출력하려면 strary[i] 로 변환 명세 %s 를 이용
char strary[][5] = {"c", "c++", "java", "c#"};
for (i = 0; i < 4; ) printf("%-8s", strary[i++]); printf("\n");