untitled

Size: px
Start display at page:

Download "untitled"

Transcription

1

2

3 자료형 기본자료형 : char, int, float, double 등 파생자료형 : 배열, 열거형, 구조체, 공용체 vs

4 struct 구조체 _ 태그 _ 이름 자료형멤버 _ 이름 ; 자료형멤버 _ 이름 ;... ; struct student int number; // char name[10]; // double height; // ;

5 // x값과 y값으로이루어지는화면의좌표 struct point int x; // x 좌표 int y; // y 좌표 ; // 복소수 struct complex double real; double imag; ; // 날짜 struct date int month; int day; int year; ; // 실수부 // 허수부 // 사각형 struct rect int x; int y; int width; int height; ; // 직원 struct employee ; char name[20]; int age; int gender; int salary; // 이름 // 나이 // 성별 // 월급

6 struct student int number; char name[20]; double height; ; int main(void) struct student s1;...

7 struct student int number; char name[10]; double height; ; struct student s1 = 24, "Kim", ;

8 s1.number = 26; strcpy(s1.name, "Kim"); s1.height = 183.2; // // //.

9 struct date int year; int month; int day; ; // struct student // int number; char name[10]; struct date dob; // double height; ; struct student s1; // s1.dob.year = 1983; s1.dob.month = 03; s1.dob.day = 29; //

10 #include <stdio.h> #include <stdlib.h> struct student int number; char name[10]; double height; ; int main(void) struct student s; s.number = ; strcpy(s.name," "); s.height = 180.2; printf(": %d\n", s.number); printf(": %s\n", s.name); printf(": %f\n", s.height); return 0; : : :

11 struct student : int number; : char name[10]; (): double height; : ; : : int main(void) struct student s; printf(" : "); scanf("%d", &s.number); printf(" : "); scanf("%s", s.name); printf(" (): "); scanf("%lf", &s.height); printf(": %d\n", s.number); printf(": %s\n", s.name); printf(": %f\n", s.height); return 0;

12 #include <math.h> struct point int x; int y; ; p2 (x,y) int main(void) struct point p1, p2; int xdiff, ydiff; double dist; printf(" (x y): "); scanf("%d %d", &p1.x, &p1.y); printf(" (x y): "); scanf("%d %d", &p2.x, &p2.y); p1 (x,y) xdiff = p1.x - p2.x; ydiff = p1.y - p2.y; dist = sqrt(xdiff * xdiff + ydiff * ydiff); printf(" %f.\n", dist); return 0; (x y): (x y):

13 struct point int x; int y; ; p1(x,y) struct rect struct point p1; struct point p2; ; p2(x,y) int main(void) struct rect r; int w, h, area, peri; printf(" : "); scanf("%d %d", &r.p1.x, &r.p1.y); printf(" : "); scanf("%d %d", &r.p2.x, &r.p2.y); : 11 : w = r.p2.x - r.p1.x; h = r.p2.x - r.p1.x; area = w * h; peri = 2 * w + 2 * h; printf(" %d %d.\n", area, peri); return 0;

14 struct point int x; int y; ; int main(void) struct point p1 = 10, 20; struct point p2 = 30, 40; p2 = p1; // if( p1==p2) // -> 컴파일오류!! printf("p1 와 p2 이같습니다.") if( (p1.x == p2.x) && (p1.y == p2.y) ) // printf("p1와 p2이같습니다.")

15 struct student int number; char name[20]; double height; ; int main(void) struct student list[100]; // list[2].number = 27; strcpy(list[2].name, " 홍길동 "); list[2].height = 178.0; struct student list[3] = 1, "Park", 172.8, 2, "Kim", 179.2, 3, "Lee", ;

16 #define SIZE 3 : : struct student (): int number; : char name[20]; : double height; (): ; int main(void) struct student list[size]; int i; for(i = 0; i < SIZE; i++) printf(" : "); scanf("%d", &list[i].number); printf(" : "); scanf("%s", list[i].name); printf(" (): "); scanf("%lf", &list[i].height); : : (): : , :, : : , :, : : , :, : for(i = 0; i< SIZE; i++) printf(": %d, : %s, : %f\n", list[i].number, list[i].name, list[i].height); return 0;

17 struct student *p; struct student s = , " 홍길동 ", ; struct student *p; p = &s; pintf(" printf(" 학번 =%d 이름 =%s 키 =%f \n", snumb s.number, sn s.name, sh s.height); ht); printf(" 학번 =%d 이름 =%s 키 =%f \n", (*p).number,(*p).name,(*p).height);

18 struct student *p; struct student s = , " 홍길동 ", ; struct student *p; p = &s; printf(" 학번 =%d 이름 =%s 키 =%f \n", s.number, s.name, s.height); printf(" 학번 =%d 이름 =%s 키 =%f \n", (*p).number,(*p).name,(*p).height); printf(" 학번 =%d 이름 =%s 키 =%f \n", p->number, p->name, p->height); (*p).number p p number == p->number p number

19 // #include <stdio.h> struct student int number; char name[20]; double height; ; int main(void) struct student s = , " ", ; struct student *p; p = &s; printf("=%d =%s % =%f \n", s.number, s.name, s.height); h printf("=%d =%s =%f \n", (*p).number,(*p).name,(*p).height); printf("=%d =%s =%f \n", p->number, p->name, p->height); return 0; = = = = = = = = =

20 struct date int month; int day; int year; ; struct student int number; char name[20]; double height; struct date *dob; ; int main(void) struct t date d = 3, 20, 1980 ; struct student s = , "Kim", ; : : Kim : : s.dob = &d; printf(": %d\n", s.number); printf(": %s\n", s.name); printf(": %f\n", s.height); printf(": %d %d %d \n", s.dob->year, s.dob->month, s.dob->day); return 0;

21 struct student int number; char name[10]; double height; struct student *next; ; int main(void) struct student s1 = 30, "Kim", 167.2, NULL ; struct student s2 = 31, "Park", 179.1, NULL ; struct student *first = NULL; struct student *current = NULL; first = &s1; s1.next = &s2; s2.next = NULL; current = first; while( current!= NULL ) printf(" =%d =%s, =%f\n", current->number, current->name, current->height); current = current->next; =30 =Kim, = =31 =Park, =

22 int equal(struct student s1, struct student s2) if( strcmp(s1.name, s2.name) == 0 ) return 1; else return 0; int equal(struct student const *p1, p, struct student const *p2) if( strcmp(p1->name, p2->name) == 0 ) return 1; else return 0;

23 struct student make_student(void) struct student s; printf(": ); scanf("%d", &s.age); printf(": ); scanf("%s", s.name); printf(" : ); scanf("%f", &s.height); s. return s;

24 #include <stdio.h> struct vector float x; float y; ; struct vector get_vector_sum(struct vector a, struct vector b); int main(void) struct vector a = 2.0, 3.0 ; struct vector b = 5.0, 6.0 ; struct vector sum; sum = get_vector_sum(a, b); printf(" (%f, %f).\n", sum.x, sum.y); a + b a b return 0; struct vector get_vector_sum(struct vector a, struct vector b) struct vector result; result.x = a.x + b.x; result.y = a.y + b.y; return result; ( , ).

25 #include <stdio.h> struct point int x; int y; ; // y int get_line_parameter(struct point p1, struct point p2, float *slope, float *yintercept) if( p1.x == p2.x ) return (-1); else *slope = (float)(p2.y - p1.y)/(float)(p2.x - p1.x); *yintercept = p1.y - (*slope) * p1.x; return (0); int main(void) struct point pt1 = 3, 3, pt2 = 6, 6; float s,y; if( get_line_parameter(pt1, pt2, &s, &y) == -1 ) printf(": x.\n"); else printf(" %f, y %f\n", s, y); return 0; , y

26 union example char c; // int i; // ;

27 #include <stdio.h> union example int i; char c; ; int main(void) union example v;. char. v.c = 'A'; printf("v v.c:%c v.i:%i\n i:%i\n", vc v.c, vi v.i ); v.i = 10000; printf("v.c:%c v.i:%i\n", v.c, v.i); int. v.c:a v.i:65 v.c: v.i:10000

28 #include <stdio.h> union ip_address unsigned long laddr; unsigned char saddr[4]; ; int main(void) union ip_address addr; addr.saddr[0] = 1; addr.saddr[1] [] = 0; addr.saddr[2] = 0; addr.saddr[3] = 127; printf("%x\n", addr.laddr); return 0; 7f000001

29 #include <stdio.h> #define STU_NUMBER 1 #define REG_NUMBER 2 struct student int type; union int stu_number; // char reg_number[15]; id; char name[20]; ; void print(struct student s) switch(s.type) // case STU_NUMBER: printf(": %d\n", s.id.stu_number); printf(": %s\n", s.name); break case REG_NUMBER: printf(": %d\n", s.id.reg_number); printf(": %s\n", s.name); break default: printf("\n"); break

30 int main(void) struct student s1, s2; s1.type = STU_NUMBER; s1.id.stu_number = ; strcpy(s1.name, " "); s2.type = REG_NUMBER; strcpy(s2.id.reg_number, " "); strcpy(s2.name, " "); print(s1); print(s2); return 0; : : : :

31 enum _ 1, 2,... ; enum days1 MON, TUE, WED, THU, FRI, SAT, SUN ; enum days2 MON=1, TUE, WED, THU, FRI, SAT, SUN ; enum days3 MON=1, TUE=2, WED=3, THU=4, FRI=5, SAT=6, SUN=7 ; enum days4 MON, TUE=2, WED=3, THU, FRI, SAT, SUN ; enum days1 d; d=wed;

32 enum days SUN, MON, TUE, WED, THU, FRI, SAT ; enum colors white, red, blue, green, black ; enum boolean 0, 1 ; enum months JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC ; enum major COMMUNICATION, COMPUTER, ELECTRIC, ELECTRONICS ; enum component MAIN_BOARD, CPU, GRAPHIC_CARD, DISK, MEMORY ; enum levels low = 1, medium, high ; enum CarOptions SunRoof = 0x01, Spoiler = 0x02, FogLights = 0x04, TintedWindows = 0x08,

33 switch(code) case 1: printf("lcd TV\n"); break; case 2: printf("pdp TV\n"); break;. #define LCD 1 #define PDP 2 enum tvtype LCD, PDP ; enum tvtype code; switch(code) case LCD: printf("lcd TV\n"); switch(code) case LCD: printf("lcd TV\n"); break; break; case PDP: case PDP: printf("pdp TV\n"); printf("pdp TV\n"); break; break;..

34 // #include <stdio.h> enum days MON, TUE, WED, THU, FRI, SAT, SUN ; char *days_name[] = "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday" ; int main(void) enum days d; for(d=mon; d<=sun; d++) printf("%d %s \n", d, days_name[d]); 0 monday 1 tuesday 2 wednesday 3 thursday 4 friday 5 saturday 6 sunday

35 #include <stdio.h> enum tvtype tube, lcd, plasma, projection ; int main(void) id) enum tvtype type; TV : 3 TV. printf("tv : "); scanf("%d", &type); switch(type) case tube: printf(" TV.\n \n"); break; return 0; case lcd: printf("lcd TV.\n"); break; case plasma: printf("pdp TV.\n"); break; case projection: printf(" TV.\n"); break; default: printf(".\n"); break;

36 typedef old_type new_type; 새로운자료형을정의 typedef unsigned char BYTE; 기존의자료형 새로운자료형 point typedef 기본자료형 int float

37 int short unsigned int unsigned short unsigned char char typedef int INT32; typedef unsigned int UINT32; INT32 i; // int i; 와같다. UINT32 k; // unsigned int k; 와같다. typedef struct point int x; int y; POINT; POINT p,q; INT32 INT16 UINT32 UINT16 UCHAR, BYTE CHAR typedef struct complex double real; double imag; COMPLEX; COMPLEX x, y; typedef enum FALSE, TRUE BOOL; BOOL condition; // enum FALSE, TRUE condition; typedef char * STRING_PTR; STRING_PTR p; // char *p;

38

39 #include <stdio.h> typedef struct point int x; int y; POINT; POINT translate(point p, POINT delta); int main(void) POINT p = 2, 3 ; POINT delta = 10, 10 ; POINT result; result = translate(p, delta); printf(" (%d, %d).\n", result.x, result.y); return 0; POINT translate(point p, POINT delta) POINT new_p; new_p.x = p.x + delta.x; new_p.y = p.y + delta.y; return new_p; (12, 13).

40

Microsoft PowerPoint - Lesson12.pptx

Microsoft PowerPoint - Lesson12.pptx 2009 Spring Computer Engineering g Programming g 1 Lesson 12 - 제 13 장구조체 Lecturer: JUNBEOM YOO jbyoo@konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 구조체란무엇인가? 구조체의선언, 초기화, 사용 구조체의배열 구조체와포인터

More information

Microsoft PowerPoint - chap-13.pptx

Microsoft PowerPoint - chap-13.pptx 쉽게풀어쓴 C 언어 Express 제 13 장구조체 컴퓨터프로그래밍기초 구조체란? 자료형 기본자료형 : char, int, float, double 등 파생자료형 : 배열, 열거형, 구조체, 공용체 구조체 : 서로다른자료형을하나로묶는구조 구조체 vs 배열 컴퓨터프로그래밍기초 2 구조체의선언 구조체선언형식 ( 예 ) 학생에대한데이터 태그 (tag) struct

More information

이번장에서학습할내용 구조체란무엇인가? 구조체의선언, 초기화, 사용 구조체의배열 구조체와포인터 구조체와함수 공용체 열거형 typedef 구조체는복잡한내용을일목요연하여정리하는데유용하게사용됩니다. 2

이번장에서학습할내용 구조체란무엇인가? 구조체의선언, 초기화, 사용 구조체의배열 구조체와포인터 구조체와함수 공용체 열거형 typedef 구조체는복잡한내용을일목요연하여정리하는데유용하게사용됩니다. 2 제 13 장구조체 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 구조체란무엇인가? 구조체의선언, 초기화, 사용 구조체의배열 구조체와포인터 구조체와함수 공용체 열거형 typedef 구조체는복잡한내용을일목요연하여정리하는데유용하게사용됩니다.

More information

11장 포인터

11장 포인터 누구나즐기는 C 언어콘서트 제 11 장구조체 이번장에서학습할내용 구조체의개념, 정의, 초기화방법 구조체와포인터와의관계 공용체와 typedef 구조체는서로다른데이터들을하나로묶는중요한도구입니다. 자료형의분류 기본자료형 : char, int, float, double 등 자료형 파생자료형 : 배열, 열거형, 구조체, 공용체 구조체의필요성 학생에대한데이터를하나로모으려면?

More information

14 주차구조체와공용체

14 주차구조체와공용체 14 주차구조체와공용체 구조체의개념, 정의, 초기화방법 구조체와포인터와의관계 공용체와 typedef 자료형구조 자료형 (data type) 기초자료형 파생자료형 사용자정의자료형 char int float double void 배열포인터구조체공용체 typedef enum 구조체의용도 복잡한형태의데이터란한가지형태의자료가아닌복합형의자료로구성되어있어기본자료형이나배열로는표현하기힘든형태의데이터를말한다.

More information

Microsoft PowerPoint - 제13장 구조체

Microsoft PowerPoint - 제13장 구조체 쉽게풀어쓴 C 언어 Express 제 13 장구조체 이번장에서학습할내용 구조체의개념, 정의, 초기화방법 구조체와포인터와의관계 공용체와 typedef 구조체는서로다른데이터들을하나로묶는중요한도구입니다. 자료형의분류 기본자료형 : char, int, float, double 등 자료형 파생자료형 : 배열, 열거형, 구조체, 공용체 구조체의필요성 학생에대한데이터를하나로모으려면?

More information

Microsoft PowerPoint - ch08 - 구조체 (structure) am0845

Microsoft PowerPoint - ch08 - 구조체 (structure) am0845 구조체와함수 구조체를함수의인수로전달하는경우 구조체의복사본이함수로전달되게된다. 만약구조체의크기가크면그만큼시간과메모리가소요된다. int equal(struct student s1, struct student s2) { if( strcmp(s1.name, s2.name) == 0 ) return 1; else return 0; 8-40 구조체와함수 구조체의포인터를함수의인수로전달하는경우

More information

Microsoft PowerPoint - ch08 - 구조체 (structure) am0845

Microsoft PowerPoint - ch08 - 구조체 (structure) am0845 2015-1 프로그래밍언어 8. 구조체 (Structure) 2015 년 4 월 11 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) Outline 구조체란무엇인가? 구조체의선언, 초기화, 사용

More information

기초컴퓨터프로그래밍

기초컴퓨터프로그래밍 구조체 #include int main() { } printf("structure\n"); printf("instructor: Keon Myung Lee\n"); return 0; 내용 구조체 (struct) Typedef 공용체 (union) 열거형 (enum) 구조체 구조체 (structure) 어떤대상을표현하는서로연관된항목 ( 변수 )

More information

untitled

untitled if( ) ; if( sales > 2000 ) bonus = 200; if( score >= 60 ) printf(".\n"); if( height >= 130 && age >= 10 ) printf(".\n"); if ( temperature < 0 ) printf(".\n"); // printf(" %.\n \n", temperature); // if(

More information

슬라이드 1

슬라이드 1 9 장구조체와공용체 박종혁교수 UCS Lab Tel: 970-6702 Email: jhpark1@seoultech.ac.kr SeoulTech 2017-1 st 프로그래밍입문 (1) 2 구조체와공용체 C 언어의확장방법 매크로와라이브러리 사용자정의자료형 ( 배열, 구조체, 공용체 ) // 파생형자료형으로쓰기도함 구조체의필요성 int number; char name[10];

More information

untitled

untitled while do-while for break continue while( ) ; #include 0 i int main(void) int meter; int i = 0; while(i < 3) meter = i * 1609; printf("%d %d \n", i, meter); i++; return 0; i i< 3 () 0 (1)

More information

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt 변수와상수 1 변수란무엇인가? 변수 : 정보 (data) 를저장하는컴퓨터내의특정위치 ( 임시저장공간 ) 메모리, register 메모리주소 101 번지 102 번지 변수의크기에따라 주로 byte 단위 메모리 2 기본적인변수형및변수의크기 변수의크기 해당컴퓨터에서는항상일정 컴퓨터마다다를수있음 short

More information

K&R2 Reference Manual 번역본

K&R2 Reference Manual 번역본 typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct

More information

untitled

untitled int i = 10; char c = 69; float f = 12.3; int i = 10; char c = 69; float f = 12.3; printf("i : %u\n", &i); // i printf("c : %u\n", &c); // c printf("f : %u\n", &f); // f return 0; i : 1245024 c : 1245015

More information

Microsoft PowerPoint - Chapter_09.pptx

Microsoft PowerPoint - Chapter_09.pptx 프로그래밍 1 1 Chapter 9. Structures May, 2016 Dept. of software Dankook University http://embedded.dankook.ac.kr/~baeksj 구조체의개념 (1/4) 2 (0,0) 구조체 : 다양한종류의데이터로구성된사용자정의데이터타입 복잡한자료를다루는것을편하게해줌 예 #1: 정수로이루어진 x,

More information

; struct point p[10] = {{1, 2, {5, -3, {-3, 5, {-6, -2, {2, 2, {-3, -3, {-9, 2, {7, 8, {-6, 4, {8, -5; for (i = 0; i < 10; i++){ if (p[i].x > 0 && p[i

; struct point p[10] = {{1, 2, {5, -3, {-3, 5, {-6, -2, {2, 2, {-3, -3, {-9, 2, {7, 8, {-6, 4, {8, -5; for (i = 0; i < 10; i++){ if (p[i].x > 0 && p[i ; struct point p; printf("0이아닌점의좌표를입력하시오 : "); scanf("%d %d", &p.x, &p.y); if (p.x > 0 && p.y > 0) printf("1사분면에있다.\n"); if (p.x < 0 && p.y > 0) printf("2사분면에있다.\n"); if (p.x < 0 && p.y < 0) printf("3사분면에있다.\n");

More information

BACK TO THE BASIC C++ 버그 헌팅: 버그를 예방하는 11가지 코딩 습관

BACK TO THE BASIC C++ 버그 헌팅: 버그를 예방하는 11가지 코딩 습관 Hanbit ebook Realtime 30 C++ 버그 헌팅 버그를 예방하는 11가지 코딩 습관 Safe C++ 블라디미르 쿠스퀴니르 지음 / 정원천 옮김 이 도서는 O REILLY의 Safe C++의 번역서입니다. BACK TO THE BASIC C++ 버그 헌팅 버그를 예방하는 11가지 코딩 습관 BACK TO THE BASIC C++ 버그 헌팅 버그를

More information

03장.스택.key

03장.스택.key ---------------- DATA STRUCTURES USING C ---------------- 03CHAPTER 1 ? (stack): (LIFO:Last-In First-Out) 2 : top : ( index -1 ),,, 3 : ( ) ( ) -> ->. ->.... 4 Stack ADT : (LIFO) : init():. is_empty():

More information

int main(void) int a; int b; a=3; b=a+5; printf("a : %d \n", a); printf("b : %d \n", b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf(" a : %x \

int main(void) int a; int b; a=3; b=a+5; printf(a : %d \n, a); printf(b : %d \n, b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf( a : %x \ ? 1 int main(void) int a; int b; a=3; b=a+5; printf("a : %d \n", a); printf("b : %d \n", b); a b 3 a a+5 b &a(12ff60) &b(12ff54) 3 a 8 b printf(" a : %x \n", &a); printf(" b : %x \n", &b); * : 12ff60,

More information

C 언어 프로그래밊 과제 풀이

C 언어 프로그래밊 과제 풀이 과제풀이 (1) 홀수 / 짝수판정 (1) /* 20094123 홍길동 20100324 */ /* even_or_odd.c */ /* 정수를입력받아홀수인지짝수인지판정하는프로그램 */ int number; printf(" 정수를입력하시오 => "); scanf("%d", &number); 확인 주석문 가필요한이유 printf 와 scanf 쌍

More information

Microsoft PowerPoint - chap11-포인터의활용.pptx

Microsoft PowerPoint - chap11-포인터의활용.pptx #include int main(void) int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; 1 학습목표 포인터를 사용하는 다양한 방법에

More information

구조체정의 자료형 (data types) 기본자료형 (primitive data types) : char, int, float 등과같이 C 언어에서제공하는자료형. 사용자정의자료형 (user-defined data types) : 다양한자료형을묶어서목적에따라새로운자료형을

구조체정의 자료형 (data types) 기본자료형 (primitive data types) : char, int, float 등과같이 C 언어에서제공하는자료형. 사용자정의자료형 (user-defined data types) : 다양한자료형을묶어서목적에따라새로운자료형을 (structures) 구조체정의 구조체선언및초기화 구조체배열 구조체포인터 구조체배열과포인터 구조체와함수 중첩된구조체 구조체동적할당 공용체 (union) 1 구조체정의 자료형 (data types) 기본자료형 (primitive data types) : char, int, float 등과같이 C 언어에서제공하는자료형. 사용자정의자료형 (user-defined

More information

1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 #define _CRT_SECURE_NO_WARNINGS #include #include main() { char ch; printf(" 문자 1개를입력하시오 : "); scanf("%c", &ch); if (isalpha(ch))

More information

Microsoft PowerPoint - 07_(C_Programming)_(Korean)_Composite_Data_Types

Microsoft PowerPoint - 07_(C_Programming)_(Korean)_Composite_Data_Types C Programming 복합데이터유형 (Composite Data Types) Seo, Doo-Ok Clickseo.com clickseo@gmail.com 목 차 구조체 구조체와포인터그리고함수 공용체와열거형 2 구조체 구조체 구조체배열 중첩구조체 구조체와포인터그리고함수 공용체와열거형 3 구조체 (Structure) 구조체 (1/8) 서로연관된원소들의집합을하나의이름으로묶어놓은것

More information

61 62 63 64 234 235 p r i n t f ( % 5 d :, i+1); g e t s ( s t u d e n t _ n a m e [ i ] ) ; if (student_name[i][0] == \ 0 ) i = MAX; p r i n t f (\ n :\ n ); 6 1 for (i = 0; student_name[i][0]!= \ 0&&

More information

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4

0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x = (12 + 6) / 2 * 3; x = 27 x = 3 * (8 / 4 Introduction to software design 2012-1 Final 2012.06.13 16:00-18:00 Student ID: Name: - 1 - 0. 표지에이름과학번을적으시오. (6) 1. 변수 x, y 가 integer type 이라가정하고다음빈칸에 x 와 y 의계산결과값을적으시오. (5) x = (3 + 7) * 6; x = 60 x

More information

중간고사

중간고사 중간고사 예제 1 사용자로부터받은두개의숫자 x, y 중에서큰수를찾는알고리즘을의사코드로작성하시오. Step 1: Input x, y Step 2: if (x > y) then MAX

More information

歯9장.PDF

歯9장.PDF 9 Hello!! C printf() scanf() getchar() putchar() gets() puts() fopen() fclose() fprintf() fscant() fgetc() fputs() fgets() gputs() fread() fwrite() fseek() ftell() I/O 2 (stream) C (text stream) : `/n'

More information

chap8.PDF

chap8.PDF 8 Hello!! C 2 3 4 struct - {...... }; struct jum{ int x_axis; int y_axis; }; struct - {...... } - ; struct jum{ int x_axis; int y_axis; }point1, *point2; 5 struct {....... } - ; struct{ int x_axis; int

More information

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어 개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,

More information

Hanyang Volunteer Corps volunteer image

Hanyang Volunteer Corps volunteer image Volunteer Hanyang Volunteer Corps volunteer image Volunteer Interview 1 4 5 6 7 Volunteer Interview 1 Volunteer Interview 2 8 9 11 10 Volunteer Interview 2 12 13 Sunday Monday Tuesday Wednesday Thursday

More information

본 강의에 들어가기 전

본 강의에 들어가기 전 C 기초특강 종합과제 과제내용 구조체를이용하여교과목이름과코드를파일로부터입력받아관리 구조체를이용하여학생들의이름, 학번과이수한교과목의코드와점수를파일로부터입력 학생개인별총점, 평균계산 교과목별이수학생수, 총점및평균을계산 결과를파일에저장하는프로그램을작성 2 Makefile OBJS = score_main.o score_input.o score_calc.o score_print.o

More information

13주-14주proc.PDF

13주-14주proc.PDF 12 : Pro*C/C++ 1 2 Embeded SQL 3 PRO *C 31 C/C++ PRO *C NOT! NOT AND && AND OR OR EQUAL == = SQL,,, Embeded SQL SQL 32 Pro*C C SQL Pro*C C, C Pro*C, C C 321, C char : char[n] : n int, short, long : float

More information

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7>

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7> 제14장 동적 메모리 할당 Dynamic Allocation void * malloc(sizeof(char)*256) void * calloc(sizeof(char), 256) void * realloc(void *, size_t); Self-Referece NODE struct selfref { int n; struct selfref *next; }; Linked

More information

Microsoft PowerPoint - chap03-변수와데이터형.pptx

Microsoft PowerPoint - chap03-변수와데이터형.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num %d\n", num); return 0; } 1 학습목표 의 개념에 대해 알아본다.

More information

....201506

....201506 TFT 2015 06 7 12 % 5 13 % 6 46 % 3 % 8 % 14 % 33% 2 % 22 % 23 % 29 % 50 % 18 % 5 28 % 8 1 % 4 % 22 % 7 % 26 % 41 % 5 % 5 % 10 % 6 % 10 % 8 % 12 % 12 % 50 % 23 % 10 % 5 22 % 15 % % 3 % 3 % QUIZ mind tip

More information

<C7E0BAB9C0AFBCBA5F323031365F30365F322E696E6464>

<C7E0BAB9C0AFBCBA5F323031365F30365F322E696E6464> 2016.06 www.yuseong.go.kr Vol.125 2016.06 www.yuseong.go.kr Vol.125 04 06 08 10 12 14 18 20 21 22 23 24 26 28 29 30 04 06 2016.06 www.yuseong.go.kr Vol.125 14 12 23 4 2016. 06 5 6 2016. 06 7 모이자~ 8 2016.

More information

Microsoft PowerPoint - chap13-입출력라이브러리.pptx

Microsoft PowerPoint - chap13-입출력라이브러리.pptx #include int main(void) int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; 1 학습목표 스트림의 기본 개념을 알아보고,

More information

Microsoft PowerPoint - chap10-함수의활용.pptx

Microsoft PowerPoint - chap10-함수의활용.pptx #include int main(void) { int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; } 1 학습목표 중 값에 의한 전달 방법과

More information

Microsoft PowerPoint - chap12-고급기능.pptx

Microsoft PowerPoint - chap12-고급기능.pptx #include int main(void) int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); return 0; 1 학습목표 가 제공하는 매크로 상수와 매크로

More information

F.

F. www.i815.or.kr 2004 12 04 08 10 12 14 16 18 20 23 25 28 31 33 34 35 37 38 41 50 200412 vol. 202 (kye@i815.or.kr 041-560-0244) 4 www.i815.or.kr 2004 December 5 6 www.i815.or.kr 2004 December 7 8 www.i815.or.kr

More information

chap7.key

chap7.key 1 7 C 2 7.1 C (System Calls) Unix UNIX man Section 2 C. C (Library Functions) C 1975 Dennis Ritchie ANSI C Standard Library 3 (system call). 4 C?... 5 C (text file), C. (binary file). 6 C 1. : fopen( )

More information

TFT 2015 04 02 03 3.57 3.98 3.36 3.68 4.06 5% 41% 3.45 3.26 0 1 2 3 4 5 47% 7.1% 13.6% 2.2% 29.3% 13.0% 10.9% 7% 0% 23.9% 24.3% 20.6% 7.5% 5.6% 23.4% 18.7% 15.8% 6.6% 7.7% 20.2% 18.6% 12.0% 19.2% 04 05

More information

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770>

<322EBCF8C8AF28BFACBDC0B9AEC1A6292E687770> 연습문제해답 5 4 3 2 1 0 함수의반환값 =15 5 4 3 2 1 0 함수의반환값 =95 10 7 4 1-2 함수의반환값 =3 1 2 3 4 5 연습문제해답 1. C 언어에서의배열에대하여다음중맞는것은? (1) 3차원이상의배열은불가능하다. (2) 배열의이름은포인터와같은역할을한다. (3) 배열의인덱스는 1에서부터시작한다. (4) 선언한다음, 실행도중에배열의크기를변경하는것이가능하다.

More information

5월고용내지

5월고용내지 http://busan.molab.go.kr www.work.go.kr 5 2008 May 5 http://busan.molab.go.kr, http://www.work.go.kr Contents http://busan.molab.go.kr...3 PHOTO NEWS 4... www.work.go.kr PHOTO NEWS PHOTO NEWS http://busan.molab.go.kr...5

More information

11장 포인터

11장 포인터 Dynamic Memory and Linked List 1 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것 메모리의크기는프로그램이시작하기전에결정 int i, j; int buffer[80]; char name[] = data structure"; 처음에결정된크기보다더큰입력이들어온다면처리하지못함

More information

06.._........_12...._....

06.._........_12...._.... 2006 December12 66 32 CONTENTS 04 Spirit 06 10 14 18 Special 20 Mission 28 32 35 Culture 38 40 42 46 47 People 48 50 69 48 28 People 52 Education 53 54 News 56 57 58 63 65 66 68 69 Heart 70 74 www.juan.or.kr/joy

More information

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074> Chap #2 펌웨어작성을위한 C 언어 I http://www.smartdisplay.co.kr 강의계획 Chap1. 강의계획및디지털논리이론 Chap2. 펌웨어작성을위한 C 언어 I Chap3. 펌웨어작성을위한 C 언어 II Chap4. AT89S52 메모리구조 Chap5. SD-52 보드구성과코드메모리프로그래밍방법 Chap6. 어드레스디코딩 ( 매핑 ) 과어셈블리어코딩방법

More information

02장.배열과 클래스

02장.배열과 클래스 ---------------- DATA STRUCTURES USING C ---------------- CHAPTER 배열과구조체 1/20 많은자료의처리? 배열 (array), 구조체 (struct) 성적처리프로그램에서 45 명의성적을저장하는방법 주소록프로그램에서친구들의다양한정보 ( 이름, 전화번호, 주소, 이메일등 ) 를통합하여저장하는방법 홍길동 이름 :

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 오픈소스소프트웨어개발입문 (CP33992) 사용자정의자료형 부산대학교공과대학정보컴퓨터공학부 학습목표 여러자료형변수들의집합체인구조체와공용체의특징과차이점을이해할수있다. 구조체 구조체선언과사용방법을알수있다. 구조체배열을이용한프로그램을할수있다. 구조체포인터를이용한프로그램을할수있다. 구조체자체혹은구조체포인터를매개변수로전달할수있다. 구조체의멤버로서다른구조체를사용할수있다.

More information

chap10.PDF

chap10.PDF 10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern

More information

Microsoft PowerPoint - 제11장 포인터

Microsoft PowerPoint - 제11장 포인터 쉽게풀어쓴 C 언어 Express 제 11 장포인터 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 포인터란? 포인터 (pointer): 주소를가지고있는변수 1003 1004 1005 영화관 1002 1006 1001 포인터 (pointer) 1007 메모리의구조

More information

C++-¿Ïº®Çؼ³10Àå

C++-¿Ïº®Çؼ³10Àå C C++. (preprocessor directives), C C++ C/C++... C++, C. C++ C. C C++. C,, C++, C++., C++.,.. #define #elif #else #error #if #itdef #ifndef #include #line #pragma #undef #.,.,. #include #include

More information

Microsoft PowerPoint - 제11장 포인터(강의)

Microsoft PowerPoint - 제11장 포인터(강의) 쉽게풀어쓴 C 언어 Express 제 11 장포인터 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 포인터란? 포인터 (pointer): 주소를가지고있는변수 1003 1004 1005 영화관 1002 1006 1001 포인터 (pointer) 1007 메모리의구조

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Web server porting 2 Jo, Heeseung Web 을이용한 LED 제어 Web 을이용한 LED 제어프로그램 web 에서데이터를전송받아타겟보드의 LED 를조작하는프로그램을작성하기위해다음과같은소스파일을생성 2 Web 을이용한 LED 제어 LED 제어프로그램작성 8bitled.html 파일을작성 root@ubuntu:/working/web# vi

More information

06³â_±â»ÝÀÇ»ù_10¿ùÈ£_À¥Áø

06³â_±â»ÝÀÇ»ù_10¿ùÈ£_À¥Áø 2006 October10 66 62 CONTENTS 04 Spirit 06 10 14 18 Special 20 Mission 26 30 32 Culture 34 36 38 42 43 People 44 46 65 44 26 People 48 50 Education 51 52 News 54 55 56 60 62 64 65 66 Heart 68 71 72 www.juan.or.kr/joy

More information

Microsoft PowerPoint - chap09-1.ppt

Microsoft PowerPoint - chap09-1.ppt 참고자료 : chapter 9-1. 구조체 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 구조체의형선언과멤버참조 구조체는배열과달리다른형태의자료형도묶어서처리할수있다. 한학생과관련된여러형태의데이터를묶어서처리할수있으므로배열보다효율적이다. - 5 명의학생에대한학번과학점을처리하는예

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 C 언어포인터정복하기 16 강. 포인터로자료구조화하기 TAE-HYONG KIM COMPUTER ENG, KIT 2 학습내용 구조체멤버와구조체포인터멤버 다른구조체 ( 변수 ) 를가리키는구조체 ( 변수 ) 연결된리스트 의구성및관리 포인터로 연결된리스트 탐색하기 3 중첩구조체에자료저장하기 중첩된구조체변수에값저장하기 struct person { char PRID[15];

More information

독립기념관 7월호 3p

독립기념관 7월호 3p www.i815.or.kr 04 06 08 10 12 14 16 18 19 20 21 22 23 24 26 28 30 32 34 36 38 40 42 43 44 45 46 47 50 www.i815.or.kr 2006. JULY www.i815.or.kr 2006. JULY www.i815.or.kr 2006. JULY www.i815.or.kr 2006.

More information

1 장 C 언어복습 표준입출력배열포인터배열과포인터함수 const와포인터구조체컴파일러사용방법 C++ 프로그래밍입문

1 장 C 언어복습 표준입출력배열포인터배열과포인터함수 const와포인터구조체컴파일러사용방법 C++ 프로그래밍입문 1 장 C 언어복습 표준입출력배열포인터배열과포인터함수 const와포인터구조체컴파일러사용방법 C++ 프로그래밍입문 1. 표준입출력 표준입출력 입력 : 키보드, scanf 함수 출력 : 모니터, printf 함수문제 : 정수값 2개를입력받고두값사이의값들을더하여출력하라. #include int main(void) int Num1, Num2; int

More information

....2....

....2.... 11-B370008-000001-06 www.i815.or.kr 02 2005 04 06 08 10 12 14 16 18 20 22 24 26 28 30 33 34 36 38 40 44 45 46 50 200502 vol. 204 (hjlim@i815.or.kr 041-560-0244) 4 www.i815.or.kr 2005 February 5 6 www.i815.or.kr

More information

April. 28, 216 Fixed Income Analyst 2 3 2. 1.5 (%) (%).1.5. (%) (%) 1. 1 y 2 y 3 y 4 y 5 y 7 y 1 1 1 2 -.5 2.5 2.2 (%) 1y 3y 5y 1y (%) 1.9 1.6 1.3 1. '15Y.8 '15Y.12 '16Y.4 (%) (%) () Apr. 28, 216

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

Microsoft PowerPoint - chap-11.pptx

Microsoft PowerPoint - chap-11.pptx 쉽게풀어쓴 C 언어 Express 제 11 장포인터 컴퓨터프로그래밍기초 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 컴퓨터프로그래밍기초 2 포인터란? 포인터 (pointer): 주소를가지고있는변수 컴퓨터프로그래밍기초 3 메모리의구조 변수는메모리에저장된다. 메모리는바이트단위로액세스된다.

More information

제 11 장포인터 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다.

제 11 장포인터 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 제 11 장포인터 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습합니다.

More information

106 107, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float

106 107, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float Part 2 31 32 33 106 107, ( ),, ( ), 3, int kor[5]; int eng[5]; int Microsoft Windows 4 (ANSI C2 ) int kor[5] 20 # define #define SIZE 20 int a[10]; char c[10]; float f[size]; /* 10 /* c 10 /* f 20 3 1

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2

목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2 제 8 장. 포인터 목차 포인터의개요 배열과포인터 포인터의구조 실무응용예제 C 2 포인터의개요 포인터란? 주소를변수로다루기위한주소변수 메모리의기억공간을변수로써사용하는것 포인터변수란데이터변수가저장되는주소의값을 변수로취급하기위한변수 C 3 포인터의개요 포인터변수및초기화 * 변수데이터의데이터형과같은데이터형을포인터 변수의데이터형으로선언 일반변수와포인터변수를구별하기위해

More information

....201505 ....

....201505 .... Thanks story 02 03 04 05 survey 06 07 1 100 2 12 28 31 38 12 02 39 47 3 4 5 02 29 29 40 13 1 0 2 32 8 18 36 36 54 Knowhow 08 09 tip 0 thanks note 10 11 12 13 14 15 16 17 18 행복한 가정 만들기 19 어디로 갈지 못 정했다면

More information

윤성우의 열혈 TCP/IP 소켓 프로그래밍

윤성우의 열혈 TCP/IP 소켓 프로그래밍 C 프로그래밍프로젝트 Chap 22. 구조체와사용자정의자료형 1 2013.10.10. 오병우 컴퓨터공학과 구조체의정의 (Structure) 구조체 하나이상의기본자료형을기반으로사용자정의자료형 (User Defined Data Type) 을만들수있는문법요소 배열 vs. 구조체 배열 : 한가지자료형의집합 구조체 : 여러가지자료형의집합 사용자정의자료형 struct

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

11장 포인터

11장 포인터 누구나즐기는 C 언어콘서트 제 9 장포인터 이번장에서학습할내용 포인터이란? 변수의주소 포인터의선언 간접참조연산자 포인터연산 포인터와배열 포인터와함수 이번장에서는포인터의기초적인지식을학습한다. 포인터란? 포인터 (pointer): 주소를가지고있는변수 메모리의구조 변수는메모리에저장된다. 메모리는바이트단위로액세스된다. 첫번째바이트의주소는 0, 두번째바이트는 1, 변수와메모리

More information

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100 2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack

More information

Microsoft Word - retail_131122.doc

Microsoft Word - retail_131122.doc Analyst 유주연 (639-4584) juyeon.yu@meritz.co.kr RA 박지은 (639-451) jeeeun.park@meritz.co.kr 213.11.22 유통업 Overweight 1월 매출동향: 대형마트 -6.4%, 백화점 -2.2% Top Pick 하이마트 (7184) Buy, TP 15,원 현대홈쇼핑 (575) Buy, TP 21,원

More information

C 언어의구성요소인상수, 변수, 입 출력함수에 대하여학습

C 언어의구성요소인상수, 변수, 입 출력함수에 대하여학습 C 언어의구성요소인상수, 변수, 입 출력함수에 대하여학습 구성요소 * 주석 * 변수, 상수 * 함수 * 문장 * 출력함수 printf() * 입력함수 scanf() * 산술연산 * 대입연산 예 /* 두개의숫자의합을계산하는프로그램 */ #include { int main(void) int x; // 첫번째정수를저장할변수 int y; // 두번째정수를저장할변수

More information

제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다.

제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 제 14 장포인터활용 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 이중포인터란무엇인가? 포인터배열 함수포인터 다차원배열과포인터 void 포인터 포인터는다양한용도로유용하게활용될수있습니다. 2 이중포인터

More information

시설공단-11월도큐

시설공단-11월도큐 CEO 친절 or 불친절 혹시 나의 모습은? 고객만족 서비스 경영 실현을 위한 친절 특강 어떻게 하면 고객이 불편해 할까요? 연극 공연 3 미술의 거리 각종 행사 잇따라 전통혼례예절 무료강좌 캐리커처 작품 전시회 등 현장에서 직접 시민들을 대하는 직원들의 친절 서비 스 마인드 함양을 위한 시민만족 서비스 친절교육과 불 친절사례 연극 공연이 지난 10월 24일

More information

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Function) 1. 함수의개념 입력에대해적절한출력을발생시켜주는것 내가 ( 프로그래머 ) 작성한명령문을연산, 처리, 실행해주는부분 ( 모듈 ) 자체적으로실행되지않으며,

More information

½Å³âÈ£-Ç¥Áö

½Å³âÈ£-Ç¥Áö & Mandarin FOOD INFORMATION FOODMERCE 26 27 C O N T E N T S 04 06 08 10 12 14 16 18 20 23 24 26 27 2009 Happy New Year With Foodmerce FOODMERCE 4 5 FOODMERCE 6 7 FOODMERCE 8 9 FOODMERCE 10 11 2 MON

More information

10장. 구조체

10장. 구조체 2019-1 st 프로그래밍입문 (1) 10 장. 구조체 박종혁교수 서울과학기술대학교컴퓨터공학과 UCS Lab Tel: 970-6702 Email: jhpark1@seoultech.ac.kr 목차 구조체의기본 구조체의개념 구조체의정의 구조체변수의선언및초기화 구조체변수의사용 구조체변수간의초기화와대입 구조체변수의비교 typedef 구조체의활용 구조체배열 구조체포인터

More information

Jan. 27, 216 Fixed Income Analyst 1,,,, BOK 216-2, : Pass-Through of Imported Input Prices to Deomestic Producer Prices: Evidence from Sector- Level Data 2 215-53, 2p, : Alexander Chudik and Janet

More information

Microsoft PowerPoint - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 함수의인수 (argument) 전달방법 C 에서함수의인수전달방법 값에의한호출 (call-by-value): 기본적인방법 포인터에의한호출 (call-by-pointer): 포인터이용 참조에의한호출 (call-by-reference): 참조 (reference) 이용 7-35 값에의한호출 (call-by-value) 함수호출시에변수의값을함수에복사본으로전달 복사본이전달되며,

More information

歯3일_.PDF

歯3일_.PDF uuhm Daewoo Daily * 0.0% 23.6% 38.2% 50.0% 61.8% 100.0% 980 970 960 950 940 930 920 910 900 890 880 870 860 850 840 830 820 810 800 790 780 770 760 750 740 730 720 710 700 690 680 670 660 650 640 630

More information

<4D F736F F F696E74202D20C1A63134C0E520C6F7C0CEC5CD5FC8B0BFEB>

<4D F736F F F696E74202D20C1A63134C0E520C6F7C0CEC5CD5FC8B0BFEB> 쉽게풀어쓴 C 언어 Express 제 14 장포인터활용 이중포인터 이중포인터 (double pointer) : 포인터를가리키는포인터 int i = 10; int *p = &i; int **q = &p; // i 는 int 형변수 // p 는 i 를가리키는포인터 // q 는포인터 p 를가리키는이중포인터 이중포인터 이중포인터의해석 이중포인터 // 이중포인터프로그램

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 14. 포인터와함수에대한이해 2013.10.09. 오병우 컴퓨터공학과 14-1 함수의인자로배열전달 기본적인인자의전달방식 값의복사에의한전달 val 10 a 10 11 Department of Computer Engineering 2 14-1 함수의인자로배열전달 배열의함수인자전달방식 배열이름 ( 배열주소, 포인터 ) 에의한전달 #include

More information

¼Ł¿ï¸ðµåÃÖÁ¾

¼Ł¿ï¸ðµåÃÖÁ¾ Fashion Fashion Blue ocean Passion Chance Contents Blue ocean Fashion Passion Contents Chance Fashion Blue ocean Blue ocean 003 Blue ocean 004 Fashion Blue ocean 005 Blue ocean http://blog.naver.com/klcblog?redirect=log&logno=90041062323

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

Lab 3. 실습문제 (Single linked list)_해답.hwp

Lab 3. 실습문제 (Single linked list)_해답.hwp Lab 3. Singly-linked list 의구현 실험실습일시 : 2009. 3. 30. 담당교수 : 정진우 담당조교 : 곽문상 보고서제출기한 : 2009. 4. 5. 학과 : 학번 : 성명 : 실습과제목적 : 이론시간에배운 Singly-linked list를실제로구현할수있다. 실습과제내용 : 주어진소스를이용해 Singly-linked list의각함수를구현한다.

More information

ABC 9장

ABC 9장 9 장구조체와공용체 0 구조체와공용체 C 언어의확장방법 - 매크로와라이브러리 - 사용자정의형 ( 배열, 구조체, 공용체 ) 9-1 구조체 서로다른형의변수들을하나로묶어주는방법 예제 - 카드 9-2 구조체 예제 - 카드 - 각카드는고유의무늬와숫자를가짐 구조체를사용하여표현하면효율적 - 카드를위한구조체선언 struct card { int pips; char suit;

More information

OCW_C언어 기초

OCW_C언어 기초 초보프로그래머를위한 C 언어기초 4 장 : 연산자 2012 년 이은주 학습목표 수식의개념과연산자및피연산자에대한학습 C 의알아보기 연산자의우선순위와결합방향에대하여알아보기 2 목차 연산자의기본개념 수식 연산자와피연산자 산술연산자 / 증감연산자 관계연산자 / 논리연산자 비트연산자 / 대입연산자연산자의우선순위와결합방향 조건연산자 / 형변환연산자 연산자의우선순위 연산자의결합방향

More information

<4D F736F F F696E74202D20C1A63137C0E520B5BFC0FBB8DEB8F0B8AEBFCD20BFACB0E1B8AEBDBAC6AE>

<4D F736F F F696E74202D20C1A63137C0E520B5BFC0FBB8DEB8F0B8AEBFCD20BFACB0E1B8AEBDBAC6AE> 쉽게풀어쓴 C 언어 Express 제 17 장동적메모리와연결리스트 이번장에서학습할내용 동적메모리할당의이해 동적메모리할당관련함수 연결리스트 동적메모리할당에대한개념을이해하고응용으로연결리스트를학습합니다. 동적할당메모리의개념 프로그램이메모리를할당받는방법 정적 (static) 동적 (dynamic) 정적메모리할당 정적메모리할당 프로그램이시작되기전에미리정해진크기의메모리를할당받는것

More information

슬라이드 1

슬라이드 1 9 장구조체와공용체 박종혁교수 UCS Lab Tel: 970-6702 Email: jhpark1@seoultech.ac.kr SeoulTech 2012-1 st 프로그래밍입문 (1) 2 구조체와공용체 C 언어의확장방법 매크로와라이브러리 사용자정의형 ( 배열, 구조체, 공용체 ) 3 구조체 서로다른형의변수들을하나로묶어주는방법 예제 - 카드 4 구조체 예제 -

More information

C 프로그래밊 개요

C 프로그래밊 개요 구조체 2009 년 5 월 19 일 김경중 강의계획수정 일자계획 Quiz 실습보강 5 월 19 일 ( 화 ) 구조체 Quiz ( 함수 ) 5 월 21 일 ( 목 ) 구조체저녁 6 시 5 월 26 일 ( 화 ) 포인터 5 월 28 일 ( 목 ) 특강 (12:00-1:30) 6 월 2 일 ( 화 ) 포인터 Quiz ( 구조체 ) 저녁 6 시 6 월 4 일 ( 목

More information

프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음

프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음 프로그래밍개론및실습 2015 년 2 학기프로그래밍개론및실습과목으로본내용은강의교재인생능출판사, 두근두근 C 언어수업, 천인국지음을발췌수정하였음 CHAPTER 9 둘중하나선택하기 관계연산자 두개의피연산자를비교하는연산자 결과값은참 (1) 아니면거짓 (0) x == y x 와 y 의값이같은지비교한다. 관계연산자 연산자 의미 x == y x와 y가같은가? x!= y

More information

이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2

이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2 제 17 장동적메모리와연결리스트 유준범 (JUNBEOM YOO) Ver. 2.0 jbyoo@konkuk.ac.kr http://dslab.konkuk.ac.kr 본강의자료는생능출판사의 PPT 강의자료 를기반으로제작되었습니다. 이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다.

More information

untitled

untitled Step Motor Device Driver Embedded System Lab. II Step Motor Step Motor Step Motor source Embedded System Lab. II 2 open loop, : : Pulse, 1 Pulse,, -, 1 +5%, step Step Motor (2),, Embedded System Lab. II

More information

여름호-내지원본

여름호-내지원본 Watermelon C O N T E N T S 04 06 08 10 12 14 16 18 20 23 24 25 26 FOODMERCE 4 5 FOODMERCE 6 7 FOODMERCE 8 9 FOODMERCE 10 11 3 MON 4 TUE 5 WED 6 THU 7 FRI 18 TUE 19 WED 20 THU 21 FRI 24 MON 3 MON 4

More information

KNK_C_05_Pointers_Arrays_structures_summary_v02

KNK_C_05_Pointers_Arrays_structures_summary_v02 Pointers and Arrays Structures adopted from KNK C Programming : A Modern Approach 요약 2 Pointers and Arrays 3 배열의주소 #include int main(){ int c[] = {1, 2, 3, 4}; printf("c\t%p\n", c); printf("&c\t%p\n",

More information