1 / 9

C Programming Practice Time

C Programming Practice Time. Week 9. To do. 구조체 오늘 소요 시간 : 약 1 시간. 구조체. 여러 Type 들을 한번에 조직화하여 가지고 있을 수 있음 struct 구조체이름 { type 멤버명칭 1; type 멤버명칭 2; type 멤버명칭 3; };. 구조체. struct Student { char *name; // student name double hw[3]; // homework grades

cachez
Download Presentation

C Programming Practice Time

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. C Programming Practice Time Week 9.

  2. To do • 구조체 • 오늘 소요 시간 : 약 1시간

  3. 구조체 • 여러 Type들을 한번에 조직화하여 가지고 있을 수 있음 struct 구조체이름 { type 멤버명칭1; type 멤버명칭2; type 멤버명칭3; };

  4. 구조체 struct Student { char *name; // student name double hw[3]; // homework grades double test[2]; // test grades double ave; // final average };

  5. 구조체 선언 • struct 구조체이름 변수명; • struct Student stu;

  6. 구조체 접근 • 구조체변수명.멤버명칭 => 하나의 변수로 취급 • printf(“학생 이름 : %s\n”, stu.name);

  7. 구조체 포인터 접근 • 구조체포인터변수명->멤버명칭 struct Student stu; struct Student* pStu = &stu; printf(“학생 이름 : %s\n”, pStu->name);

  8. 구조체 나머지 • 구조체와 함수 • 구조체와 동적 할당

  9. The End of Week 9.

More Related