Presentation is loading. Please wait.

Presentation is loading. Please wait.

Name Title Company Name

Similar presentations


Presentation on theme: "Name Title Company Name"— Presentation transcript:

1 Name Title Company Name
13. 번호가 붙은 변수, 배열 Name Title Company Name © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

2 학습할 내용 여러 개의 변수가 필요한 경우 배열과 변수의 차이 1차원 배열의 선언과 사용 scanf를 이용한 배열요소의 입력
배열과 문자열 2차원 배열의 초기화와 출력 함수와 배열 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

3 배열이란? 프로그램의 특성상 많은 수의 변수가 필요하거나 데이터를 순서대로 저장해야 한다면 변수를 사용하는 것이 불편하므로 배열이라는 기억 공간을 이용한다. 배열과 변수의 공통점 : 데이터를 기억시킬 수 있는 공간 차이점 : 배열은 변수와 달리 번호가 붙은 저장 공간 아파트나 건물 입구에 있는 우편함과 같이 층과 호수를 나타내는 번호로 구별되는 동일한 크기의 연속된 공간과 같이 배열 역시 번호로 구별되는 동일한 데이터 형의 연속된 기억 공간 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

4 야구 점수와 배열 2008년 8월 23일에 열렸던 베이징 올림픽 대한민국과 쿠바의 결승전 경기결과
각 회별로 국가를 구분하여 점수를 저장하는 경우 변수를 사용한다면 → 2*9 개의 변수가 필요함. 배열을 이용한다면 → 회수의 데이터를 순서대로 구분하여 저장할 수 있다. 배열은 많은 수의 변수가 필요한 경우나 데이터를 순서대로 저장할 필요가 있는 경우에 유용하게 사용할 수 있는 저장 공간. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

5 여러 개의 변수가 필요한 경우 한 학생의 영어 성적과 수학 성적에 대한 평균을 계산
각각의 성적을 저장하고, 점수를 출력하기 위해서는 2개의 변수가 필요함. 50명에 대한 영어 성적과 수학 성적에 대한 평균을 계산 성적을 저장하고, 출력하기 위해 100(50×2)개의 변수가 필요함. 이때 동일한 데이터 형의 변수를 이전과 같은 방법으로 선언하여 사용하기에는 다소 무리가 있다. 배열은 이와 같은 경우에 편리하게 사용할 수 있는 변수이다. 배열은 변수와 같이 데이터를 저장하는 공간이지만 번호가 붙은 특별한 변수이며, 배열을 사용할 경우에는 변수를 사용할 때와 같이 사용 전에 미리 데이터 형을 선언해 주어야 한다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

6 배열과 변수의 차이 배열에 저장된 내용 2007년 1월에 있었던 대한민국과 중국 올스타의 농구경기 2차전 결과
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

7 배열의 선언, 배열 이름, 배열 크기 1. 배열선언 2. 배열이름 3. 배열크기
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

8 1차원 배열의 선언과 사용 1차원 배열 : korea[0], korea[1]과 같이 배열 요소를 구별하는데 있어서 한 개의 첨자가 사용되는 배열 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

9 [실습문제] 실습문제 정답 베이징 올림픽 대한민국과 쿠바의 결승전 경기에 대해 1회부터 9회까지
점수결과를 [방법 2]와 [방법 3]으로 나타내시오. [방법 2] [방법 3] 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

10 [실습문제] 실습문제 정답 자신의 영문이름을 [방법 3]을 이용하여 문자형 배열에 초기화하시오.
배열 이름은 name으로 합니다. 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

11 [실습문제] 실습문제 정답 다음은 기상청에서 발췌한 우리나라의 월별 평균 기온이다.
최저기온, 최고기온, 강수량을 각각의 배열에 초기화 하시오. 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

12 배열 초기화와 데이터 저장 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

13 [실습문제] [예제 13-1]의 방법 [예제 13-2]의 방법
다음의 데이터를 [예제 13-1]과 [예제 13-2]의 방법으로 출력하는 프로그램을 작성하시오. [예제 13-1]의 방법 [예제 13-2]의 방법 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

14 [실습문제] 실습문제 정답 앞의 실습문제를 수정하여 국가별 쿼터 점수의 합계를 추가로 출력하도록 프로그램을 수정하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

15 [실습문제] 실습문제 정답 문자형 배열에 저장한 이름을 한 줄로 출력하는 프로그램을 작성하되
성과 이름 사이에 공백을 넣으시오. 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

16 [실습문제] 실습문제 정답 최고기온의 평균온도를 출력하는 프로그램을 작성하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

17 scanf를 이용한 배열요소의 입력 실행결과
변수의 값을 입력받을 경우와 마찬가지로 배열 이름 앞에 주소 연산자 &를 사용하고 제어 변수 i를 첨자로 이용 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

18 [실습문제] 실습문제 정답 쿼터별 점수를 입력받아 배열요소와 국가별 합계를 출력하는 프로그램을 작성하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

19 [실습문제] 실습문제 정답 10개의 영문 소문자를 scanf로 모두 입력받아 배열에 저장한 다음
입력된 문자를 대문자로 변환하여 한 줄에 출력하는 프로그램을 작성하시오. 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

20 배열과 문자열 문자에 대한 데이터 형인 char 형은 있으나 두 개 이상의 문자가 연속되는 문자열에 대한 데이터 형은 따로 정의되어 있지 않다. 문자열을 다루는 방법 : 문자형 배열을 이용하거나 포인터(pointer)를 이용 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

21 [참고] 문자열의 마지막에 NULL 문자를 넣는 이유
문자열을 문자형 배열에 저장할 경우 다음과 같이 실제 배열크기에 맞게 저장할 수도 있고, 배열크기보다 적은 문자열을 저장할 경우도 있다. char str[12]="Kim Eugene"; 또는 char str[12]="Lee JS"; 배열 이름(str)이나 배열의 크기(12)만으로는 실제 저장된 문자가 몇 개인가에 대한 정보를 알 수 없다. 이러한 정보가 없다면 배열에 저장된 문자열을 출력할 때나 배열에 새로운 문자열을 대입할 경우에 혼란을 가져다 줄 것이므로 추가적인 정보를 배열에 표시해야 하는데 이를 나타내는 가장 편리한 방법은 "저장된 문자열이 여기에서 끝났음"을 나타내는 NULL문자를 문자열의 마지막 부분에 넣는 것이다. 이러한 방법은 인원수를 확인하기 위해 "뒤로 번호!"를 할 때, 마지막 사람이 자신의 순번을 부르고 나서 "번호 끝!"이라고 외치는 것과 같습니다. NULL(\0)문자는 문자열이 여기서 끝났음을 나타낸다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

22 [실습문제] 배열 초기화 배열 저장 내용 자신의 영문이름과 한글이름을 문자열로 배열 name1과 name2에
초기화하시오. 영문자와는 달리 한글 한 글자는 2 byte의 공간에 저장됩니다. 배열 초기화 배열 저장 내용 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

23 문자열의 입력과 출력 문자열은 첨자를 구분하지 않고 한 번에 입력하고 출력하는 방법을 사용하므로 문자열에 대한 입출력에서 첨자를 사용할 필요가 없다. 문자열의 입력에서는 주소 연산자 &을 생략한다. 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

24 [실습문제] 실행결과 다음과 같이 초기화한 문자열을 출력하는 프로그램을 작성하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

25 [실습문제] 실행결과 [예제 13-4]를 실행하여 자신의 영문이름을 입력하되 성과 이름 사이에
공백을 넣어 입력하고 출력된 문자열을 확인하시오. 성과 이름 사이에 공백을 넣어 입력하고 출력하면 성 부분만 출력된다. 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

26 문자열 입력과 출력을 위한 라이브러리 함수 예를 들어 It is a string이라는 문자열을 scanf("%s")로 입력한다면 첫 번째 공백이 나타나는 It까지의 문자열만 변수에 저장된다. 공백이 있는 문자열을 입력 받으려면 scanf는 사용할 수 없으며 대신 라이브러리 함수 gets를 사용 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

27 문자열 입력을 위한 라이브러리 함수 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

28 문자열 출력을 위한 라이브러리 함수 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

29 [실습문제] 실행결과 함수 gets와 puts를 이용하여 자신의 영문이름을 입력하고 출력하는 프로그램을 작성하시오.
단, 이름의 입력에서 성과 이름 사이에 공백을 넣어 입력하시오. 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

30 2차원 배열의 초기화와 출력 2차원 배열은 1차원 배열과는 달리 두 개의 첨자를 사용하는 배열로서 대표적인 예로 행렬(matrix)을 들 수 있다. 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

31 2차원 배열의 초기화 2차원 배열은 배열 요소에 대해 두 개의 첨자를 사용
첫 번째 첨자는 행을, 두 번째 첨자는 열을 나타낸다. 2차원 배열의 초기화는 행을 우선으로 초기화하므로 다음의 세 가지 초기화 방법은 모두 동일. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

32 두 개의 행렬 ma와 mb의 합을 계산 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

33 두 개의 행렬 ma와 mb의 합을 계산 중첩된 반복을 이용하여 각 행렬 요소별 합을 배열 sum에 저장
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

34 두 개의 행렬 ma와 mb의 합을 계산 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

35 [실습문제] 실습문제 정답 [예제 13-9]에서 사용한 행렬 값을 scanf로 입력받아 두 행렬의
값과 두 행렬의 합을 출력하는 프로그램을 작성하시오. 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

36 [실습문제] 실습문제 정답 [예제 13-9]의 행렬에 대해 대각 원소의 값만 출력하는 프로그램을 작성하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

37 [실습문제] 실습문제 정답 [예제 13-9]의 행렬 ma에 대해 행렬요소의 합을 프로그램을 작성하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

38 2차원 배열과 문자열 2차원 배열을 이용하면 2개 이상의 문자열을 배열에 저장할 수 있다.
세 개의 국가이름을 2차원 배열에 초기화하여 출력하는 예제 첫 번째 첨자는 저장할 문자열의 개수(3)를 나타내고, 두 번째 첨자는 저장할 문자열의 길이(크기)를 나타낸다. "Thailand"를 저장하려면 최소 9 byte가 필요하므로 문자형 2차원 배열의 두 번째 첨자는 저장할 문자열 중에서 길이가 가장 큰 값(9)을 저장할 수 있는 크기로 설정해 주어야 한다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

39 2차원 배열과 문자열 2차원 문자형 배열의 두 번째 첨자는 저장할 문자열 중에서 길이가 가장 큰 값(9)을 저장할 수 있는 크기로 설정해 주어야 하기에 "Korea"와 "China"에 대해서는 기억공간의 낭비가 생긴다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

40 [실습문제] 실습문제 정답 함수 gets를 사용하여 4개의 국가이름을 한글로 입력받은 제일 마지막에
입력한 국가이름부터 출력하는 프로그램을 작성하시오. 한글 한 글자를 저장하려면 2 byte의 공간이 필요합니다. 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

41 함수와 배열 값에 의한 호출(call by value)
인수가 인자에 전달될 때 변수 자체가 전달되는 것이 아니라 변수에 저장된 값만 전달되므로 함수 정의부분에서 인자가 변하더라도 인수는 영향을 받지 않는다. 변수 n에 저장된 값(인수)만 변수 x(인자)에 전달됨 C 언어에서 함수 호출 방법은 두 가지 방법 값에 의한 호출과 참조(또는 주소)에 의한 호출(call by reference, address)을 사용 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

42 함수의 인자로 1차원 배열을 사용하는 방법 실행결과
함수 print_array를 호출하면 배열 str이 배열 a로 전달되는데 이때 배열 str의 배열 요소가 전달되는 것이 아니라 배열 str의 주소가 값에 의한 호출로 전달된다. 실행결과 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

43 [실습문제] 실습문제 정답 다음의 각 배열의 합을 계산하되 배열의 합은 함수로 작성하여 합을 반환하도록 하시오.
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

44 함수의 인자로 2차원 배열을 사용하는 방법 배열 요소의 합을 반환
함수의 인자로 2차원 배열을 사용하는 방법 배열 요소의 합을 반환 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

45 [실습문제] 실습문제 정답 다음의 두 행렬과 배열의 크기를 인자로 하여 배열의 합을 출력하는 부분을
함수로 처리하는 프로그램을 작성하시오. 이 함수는 결과를 반환하는 것이 아니라 단지 화면에 출력하는 것이므로 함수의 데이터 형을 void로 선언 실습문제 정답 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

46 [단원정리] 1/8 배열이란? 배열이 필요한 경우는? 배열과 변수의 공통점과 차이점은 ?
첨자로 구분되는 변수를 말하며 동일한 데이터 형을 갖는 연속된 기억공간에 데이터를 저장한다. 배열이 필요한 경우는? 동일한 데이터 형을 갖는 여러 개의 변수가 필요한 경우에 유용하게 사용된다. 배열은 번호가 붙는 변수이므로 데이터의 순서로 첨자를 이용한다. 배열과 변수의 공통점과 차이점은 ? 공통점 : 데이터를 저장하는 공간, 사용하기 전에 미리 선언해야 한다. 차이점 : 배열은 첨자가 붙은 변수로 생각할 수 있다. 배열은 한 번의 선언으로 여러 개의 저장공간을 생성할 수 있다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

47 [단원정리] 2/8 1차원 배열을 초기화하는 방법은? 배열 선언 시 배열의 크기와 배열 요소 개수와의 관계
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

48 [단원정리] 3/8 문자열과 배열의 초기화 방법은? 문자열의 마지막은 NULL(‘\0’)가 저장됨
© 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

49 [단원정리] 4/8 문자열의 입력과 출력 scanf사용시 주소 연산자 &를 생략 문자열을 출력할 때는 배열 이름과 %s를 사용
공백을 문자열에 삽입하는 경우는 함수 gets를 사용한다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

50 [단원정리] 5/8 2차원 배열의 초기화 2차원 배열은 배열 요소에 대해 두 개의 첨자를 사용
첫 번째 첨자는 행을, 두 번째 첨자는 열을 나타낸다. 2차원 배열의 초기화는 행을 우선으로 초기화하므로 다음의 세 가지 초기화 방법은 모두 동일. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

51 [단원정리] 6/8 2차원 배열과 문자열 2차원 문자형 배열의 두 번째 첨자는 저장할 문자열 중에서 길이가 가장 큰 값(9)을 저장할 수 있는 크기로 설정해 주어야 하기에 "Korea"와 "China"에 대해서는 기억공간의 낭비가 생긴다. 문자열이 저장된 2차원 배열의 출력 : printf(“%s\n”, nation[0]); © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

52 [단원정리] 7/8 1차원 배열과 함수 배열은 함수의 인자로 사용되거나 함수의 결과 값으로 반환할 수 있는데 배열을 반환하는 경우에는 포인터가 사용된다. 함수의 가인수로 1차원 배열을 사용할 경우에는 배열의 이름만 사용하고 배열의 크기는 생략한다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분

53 [단원정리] 8/8 2차원 배열과 함수 함수의 가인수로 2차원 배열을 사용하는 경우 행의 크기를 나타내는 첫 번째 배열 첨자는 생략할 수 있지만 두 번째 배열 첨자는 생략할 수 없다. © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. 2018년 12월 8일 오전 1시 26분2018년 12월 8일 오전 1시 26분


Download ppt "Name Title Company Name"

Similar presentations


Ads by Google