1 / 20

Pointer , String & Array

Pointer , String & Array. F.D. Pointer & String. 문자열 ? ‘/0’ 을 포함하는 문자의 집합 문자열의 저장 메모리에 연속적 저장 . 끝에 ‘/0’ 첫 글자의 시작 주소를 기억. Pointer & String. Pointer & String. str. str [0] = ? str [1] = ? str [4] = ?. Pointer & String. str. *( arr+i ) = arr [ i ] ; str [0] = *(str+0) =

Download Presentation

Pointer , String & Array

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pointer , String & Array F.D

  2. Pointer & String • 문자열? • ‘/0’을 포함하는 문자의 집합 • 문자열의 저장 • 메모리에 연속적 저장. 끝에 ‘/0’ • 첫 글자의 시작 주소를 기억

  3. Pointer & String

  4. Pointer & String str str[0] = ? str[1] = ? str[4] = ?

  5. Pointer & String str • *(arr+i) = arr[i] ; • str[0] = *(str+0) = • str[4] = *(str+4) =

  6. Pointer & String str[1] = ‘g’;

  7. Pointer & String • str ; 변수영역 • str2 ; 상수영역

  8. Pointer & String • 서식문자 %s

  9. Pointer & Array

  10. +1 +1 arr[0]+1 arr[1]+1 +1 =arr+1

  11. Pointer & Array arr[0][2] = arr[0][4] = arr[0][5] = *(arr[0]+2) *(arr[0]+4) *(arr[0]+5)

  12. Pointer & Array arr[1][2] = arr[1][-1] = arr[1][-3] = *(arr[1]+2) *(arr[1]-1) *(arr[1]-3)

  13. Pointer & Array

  14. Pointer & Array

  15. Pointer & Array pArr

  16. Pointer & Array

  17. Pointer & Array pArr

  18. Pointer & Array pArr[0][3] = pArr[0]+3 pArr pArr[0]+3 = pArr[0][3]

  19. Pointer & Array

  20. HW - Array • 달팽이 모양으로 배열에 숫자를 출력시키기 • ex ) 4 입력

More Related