PowerPoint 프레젠테이션

Size: px
Start display at page:

Download "PowerPoint 프레젠테이션"

Transcription

1 전산 SMP 11 주차 김범수 Special thanks to 박기석

2 기말고사대비총정리 기말고사화이팅

3 자료구조 많은데이터를예쁘게잘저장해서 쉽고빠르게꺼내쓰려고 데이터가많아지면찾는데도오래걸린다. Example: finding a number from a set of numbers How many comparisons do we need to retrieve 7?

4 Array

5 Multi-dimension array

6 Sorting

7 왠갑자기 Sorting Array 는자료구조 우리가원하는데이터를 Array 에서빠르게찾으려면? 저장할때잘저장해서꺼내쓸때편해야한다 데이터를효율적으로관리하는방법 데이터를저장하는자료구조 + 데이터를찾는알고리즘

8 Array Sorting Selection Sort Bubble Sort Insertion Sort

9 Selection Sort Concept

10 Selection Sort

11 Bubble Sort Concept

12 Bubble Sort Example

13 Insertion Sort Concept

14 Insertion Sort Example

15 Search

16 Sequential Search 특징 Unsorted 배열에대해서는처음부터쭉봐야하기때문에비효율적이다. Worst Case: O(n)

17 Binary Search 특징 검색대상배열은 sorted 인상태여야한다. 정렬된데이터에대해서는이진검색이빠르다 매 iteration 에서반틈 (1/2) 을서치후보에서제외시킨다.( 제외된거는볼필요없음 ) O(logn)

18 Pointer

19 Pointer 란? 데이터접근에사용되는주소를저장하는타입 포인터도타입이다 int a = 4; char c = a ; int *p = &a; p : 0x x x a a c 메모리는긴일차원공간으로볼수있고, 각 byte 는자신만의주소를가지고있다.

20 Call-by-value

21 Call-by-reference

22 Pointer 를선언할때타입이필요한이유 int *p; char *q; 어차피크기는 4byte(32 bit) 로다똑같은거아닌가? 컴퓨터가포인터로메모리에접근해데이터를읽어올때! 그포인터타입에따라가져오는 byte 수가달라진다. int * 포인터면여기서부터 4byte 까지읽어서정수로쳐 char * 포인터면여기서부터 1byte 만읽어서문자로쳐

23 배열포인터 (Pointer to Arrays) *(a + i) a[i]

24 포인터연산 포인터 p p ± n p + n * (sizeof (one element))

25 포인터와배열 int a[5]={10, 20, 30, 40, 50}; int *p=&a[2]; printf( %d %d %d %d\n,a[2], *(a+2), p[0], *(p+0)); // 30 출력 printf( %d %d %d %d\n,a[1], *(a+1), p[-1], *(p-1)); // 20 출력 a p 번지 a[0] a[1] a[2] a[3] a[4] p[-2] p[-1] p[0] p[1] p[2] *(a+0) *(a+1) *(a+2) *(a+3) *(a+4) *(p-2) *(p-1) *(p+0) *(p+1) *(p+2)

26 2 차원 Array table[2] == *(table+2) table[2][1] == (*(table+2))[1] ==*(table[2]+1) ==*(*(table+2)+1) 헷갈리니다차원배열에서는 Index 를사용하자

27 문자열과포인터 다시한번! 여러개의문자 + \0 이들어있는배열 배열의이름은첫번째 element 의주소와같다. str[0] H e l l o W o r l d! \0 str &str[0] 그래서 scanf 로 %s 받을때 & 안붙인다!

28 Scopes

29 Storage Class ( 변수의존재기간과접근범위 ) 지역변수정적변수전역변수 register 변수 지정자 auto static extern register 저장장소스택정적데이터영역정적데이터영역레지스터 선언위치함수내부함수내부 / 외부함수내부 / 외부함수내부 유효범위함수내부함수내부 / 외부프로그램전체함수내부 생존기간함수종료시프로그램종료시프로그램종료시함수종료시 초기값초기화안됨 0 으로초기화 0 으로초기화초기화안됨 29

30 Dynamic Memory Allocation 동적할당

31 왜쓰나요? 배열의크기를입력받아그크기만큼의배열을만들고싶을때 int main(void) { int size; scanf( %d, &size); } int array[size]; Compile Error! 선언은항상맨위에와야한다. 선언후에배열이할당되어야하는데 이럴때는어떻게? 프로그램실행중에메모리를할당해데이터를저장할공간을생성하는방법

32 Accessing Dynamic Memory

33 Dynamic Memory Allocation <stdlib.h> void *malloc (size_t size); void *calloc (size_t count, size_t size); void *realloc (void* ptr, size_t newsize); void free (void* ptr);

34 동적할당으로 2 차원배열만들기 포인터배열 int **table; table = (int **)calloc (3, sizeof(int *)); table[0] = (int *)calloc(4, sizeof(int));

35 포인터의부적절한사용으로인한주요부작용들 Unreachable Memory ( 이공간을가리키는포인터가존재하지않는다 ) Dangling Pointer ( 어딘가가리키고있기는하지만, 그위치에뭐가있는지알수없다.) Buffer Overflow ( 할당되어있는양이상으로메모리를다루게되는경우 ) Segmentation Fault ( 잘못된주소접근 ) 35

36 Tidy Up 동적으로할당된메모리는반드시시스템에반환해야함! 그래야다른프로그램이메모리공간을활용할수있다. ( 메모리 leak) 실행전에미리할당 vs 실행중에동적으로할당하고반환 공간이필요한만큼만쓰기때문에효율적! 메모리공간의크기는정해져있다. 얼마나큰공간이필요한지알수없을때 적당히크게? 공간이부족하거나, 공간이낭비되거나

37 Structure

38 The Type Definition (typedef) A type definition, typedef, gives a name to a data type by creating a new type that can then be used anywhere a type is permitted. 프로그래머는길게쓰는것을싫어한다 typedef int INGETER;

39 Enumerate Type 항목혹은선택지, 일종의상수항목을만들때사용 각항목들에대해 identifier 로써하나의정수 (enumeration constant) 가할당됨 상황 ) 메뉴를만들고숫자하나입력받아서 switch 문으로각기다른함수를실행해야한다. 그냥숫자 0, 1, 2, 3 으로나누면나중에헷갈리고불편함

40 Initializing Enumerated Constants enum MONTHS {JAN, FEB, MAR, APR}; identifier 자동배정 enum MONTHS {JAN = 1, FEB, MAR, APR}; enum COLORS {RED, ROSE=0, CRIMSON=0, BLUE, AQUA=1};

41 Operations on Enumerated Types enum COLORS color1, color2; color1 = BLUE; color2 = color1; if (color1 == color2) if (color1 == BLUE) switch (color1) { case BLUE:

42 Initializing Enumerated Constants enum months {JAN, FEB, MAR, APR}; identifier 자동배정 enum months {JAN = 1, FEB, MAR, APR}; enum color {RED, ROSE = 0, CRIMSON = 0, BLUE, AQUA = 1};

43 Structure Type 관련되는 element 들의집합. 어떤타입의변수라도올수있다. 단, 함수는구조체의 element 로안된다. 오직변수만가능

44 Accessing Structure Elements (*pointername).fieldname pointername - >fieldname.

45 String

46 문자열의선언 char str[15] = Good Day ; 할당한용량을모두사용할필요는없습니다. char month[] = January ; 배열크기가문자열의길이에맞춰자동으로설정 char *pstr = Good Day ; char str[9] = { G, o, o, d,, D, a, y, \0 };

47 String Copy? char str1[6] = Hello ; char str2[6]; str2 = str1; //?

48 String Input/Output Functions formatted input/output functions scanf/fscanf printf/fprintf special set of string-only functions get string (gets/fgets) put string ( puts/fputs ).

49 Difference btw. Input functions gets/fgets gets does not include newline ( \n ), fgets does. gets does not allow to specify a maximum size for str (which can lead to buffer overflows). Scanf/gets scanf 는단어단위로 (space), gets 는줄단위로 (newline)

50 Difference btw. Output functions puts appends a newline( \n) at the end automatically fputs does not write additional characters

51 FLUSH 스트림버퍼를비우는역할을한다. Scanf 등입력받는함수사용시 The string conversion code(s) skips whitespace. Test) int a; char b; scanf( %d, &a); scanf( %c,&b); printf( %d %c\n, a, b); fflush(); #define FLUSH while(getchar!= \n )

52 String Manipulation Functions #include <string.h> String Length and String Copy String Compare and String Concatenate Character in String Search for a Substring and Search for Character in Set String Span and String Token String to Number

53 List

54 What to learn

55 Linked List 각각의 Element 가다음 Element 의위치를저장하여이어진데이터스트럭쳐 연속으로쭉이어졌다면왜배열 (Array) 를안쓸까?? Array 의장점? 단점? Linked List 의장점? 단점? List Linked List Space Complexity O(n) At O(1) O(n) Insert O(n) O(1) Remove O(n) O(1)

56 Linked List 한개만가리킬수도있고, 여러개를가리킬수도있고

57 General Linear Lists 가장일반적인직렬리스트 Retrieve Insert Change Delete Traversing Building

58 Insert a Node to Empty List

59 Insert a Node at Beginning

60 Insert a Node in Middle

61 Insert a Node at End

62 Insert a Node - Code

63 Delete First Node

64 Delete - General Case Pre, Cur 두개가같이움직이는거주의!!

65 Delete a Node - Code

66 Search Linear List // 리스트 plist 가있다. struct Node *pwalker = plist; while(pwalker) { If(pWalker->data == 찾는데이터 ) return 1; pwalker = pwalker->next; } return 0;

67 Linear List Traversal

68 Print Linear List

69 Average Linear List

70 Stack Last in First out (LIFO) 의데이터스트럭쳐 Insertion과 deletion이항상한쪽끝 (Top) 에서만일어난다. Push : 새로운것을넣는작업 Pop : 젤위에서하나빼는작업

71 Stack Implementations

72 Stack Data Structure

73 Stack _ Push

74 Stack _ Pop

75 Queue First in First out(fifo) 의데이터스트럭쳐 Insertion은한쪽끝, Deletion은다른한쪽끝에서만일어난다. : Enqueue : 큐에새로운걸넣는작업 (rear) Dequeue : 큐에서하나를제거하는작업 (front)

76 Queue Implementations

77 Queue Data Structure

78 Enqueue

79 Dequeue

80 한학기배운것총정리 책에사이사이박스에있는예제코드들전부다한번씩쭉보고이해하기. 코드가있는거는충분히시험에코드짜는문제로나올수있다! Data Structure 에서는다양한 Implementation 이있기때문에무작정외우기보다는어떻게구현하는지 Concept 들을꼭기억 DS 부분은코드반드시봐야합니다. 빨간색글씨로된거기억하기

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 전산 SMP 7 주차 2015. 11. 17 김범수 bskim45@gmail.com Special thanks to 박기석 (kisuk0521@gmail.com) 지난내용복습 Pointer and its applications Pointer 란? 데이터접근에사용되는주소를저장하는타입 포인터도타입이다 int a = 4; char c = a ; int *p = &a;

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 전산 SMP 8 주차 2015. 11. 21 김범수 bskim45@gmail.com Special thanks to 박기석 (kisuk0521@gmail.com) 지난내용복습 Dynamic Memory Allocation 왜쓰나요? 배열의크기를입력받아그크기만큼의배열을만들고싶을때 int main(void) { int size; scanf( %d, &size);

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 System Software Experiment 1 Lecture 5 - Array Spring 2019 Hwansoo Han (hhan@skku.edu) Advanced Research on Compilers and Systems, ARCS LAB Sungkyunkwan University http://arcs.skku.edu/ 1 배열 (Array) 동일한타입의데이터가여러개저장되어있는저장장소

More information

11장 포인터

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

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

이번장에서학습할내용 동적메모리란? 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

슬라이드 1

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

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 전산 SMP 5 주차 2015. 10. 27 김범수 bskim45@gmail.com 들어가기전에 중간고사어땠나요? 점수는? Welcome to Array & Pointer = Hell! 지난내용복습 ~ 중간고사 자료형과형변환 연산자, 우선순위, 결합순서 산술연산자 : +,-, *, /, % 대입연산자 : =, +=, -=, *=, /=, %=,

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

<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

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning

A Dynamic Grid Services Deployment Mechanism for On-Demand Resource Provisioning C Programming Practice (II) Contents 배열 문자와문자열 구조체 포인터와메모리관리 구조체 2/17 배열 (Array) (1/2) 배열 동일한자료형을가지고있으며같은이름으로참조되는변수들의집합 배열의크기는반드시상수이어야한다. type var_name[size]; 예 ) int myarray[5] 배열의원소는원소의번호를 0 부터시작하는색인을사용

More information

chap01_time_complexity.key

chap01_time_complexity.key 1 : (resource),,, 2 (time complexity),,, (worst-case analysis) (average-case analysis) 3 (Asymptotic) n growth rate Θ-, Ο- ( ) 4 : n data, n/2. int sample( int data[], int n ) { int k = n/2 ; return data[k]

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 - ch07 - 포인터 pm0415

Microsoft PowerPoint - ch07 - 포인터 pm0415 2015-1 프로그래밍언어 7. 포인터 (Pointer), 동적메모리할당 2015 년 4 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) Outline 포인터 (pointer) 란? 간접참조연산자

More information

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

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 13. 포인터와배열! 함께이해하기 2013.10.02. 오병우 컴퓨터공학과 13-1 포인터와배열의관계 Programming in C, 정재은저, 사이텍미디어. 9 장참조 ( 교재의 13-1 은읽지말것 ) 배열이름의정체 배열이름은 Compile 시의 Symbol 로서첫번째요소의주소값을나타낸다. Symbol 로서컴파일시에만유효함 실행시에는메모리에잡히지않음

More information

<4D F736F F F696E74202D20C1A63137C0E520B5BFC0FBB8DEB8F0B8AEBFCD20BFACB0E1B8AEBDBAC6AE>

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

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 10 포인터 01 포인터의기본 02 인자전달방법 03 포인터와배열 04 포인터와문자열 변수의주소를저장하는포인터에대해알아본다. 함수의인자를값과주소로전달하는방법을알아본다. 포인터와배열의관계를알아본다. 포인터와문자열의관계를알아본다. 1.1 포인터선언 포인터선언방법 자료형 * 변수명 ; int * ptr; * 연산자가하나이면 1 차원포인터 1 차원포인터는일반변수의주소를값으로가짐

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

설계란 무엇인가?

설계란 무엇인가? 금오공과대학교 C++ 프로그래밍 jhhwang@kumoh.ac.kr 컴퓨터공학과 황준하 5 강. 배열, 포인터, 참조목차 배열 포인터 C++ 메모리구조 주소연산자 포인터 포인터연산 배열과포인터 메모리동적할당 문자열 참조 1 /20 5 강. 배열, 포인터, 참조배열 배열 같은타입의변수여러개를하나의변수명으로처리 int Ary[10]; 총 10 개의변수 : Ary[0]~Ary[9]

More information

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures 단일연결리스트 (Singly Linked List) 신찬수 연결리스트 (linked list)? tail 서울부산수원용인 null item next 구조체복습 struct name_card { char name[20]; int date; } struct name_card a; // 구조체변수 a 선언 a.name 또는 a.date // 구조체 a의멤버접근 struct

More information

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

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

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

Chapter 4. LISTS

Chapter 4. LISTS C 언어에서리스트구현 리스트의생성 struct node { int data; struct node *link; ; struct node *ptr = NULL; ptr = (struct node *) malloc(sizeof(struct node)); Self-referential structure NULL: defined in stdio.h(k&r C) or

More information

03_queue

03_queue Queue Data Structures and Algorithms 목차 큐의이해와 ADT 정의 큐의배열기반구현 큐의연결리스트기반구현 큐의활용 덱 (Deque) 의이해와구현 Data Structures and Algorithms 2 큐의이해와 ADT 정의 Data Structures and Algorithms 3 큐 (Stack) 의이해와 ADT 정의 큐는 LIFO(Last-in,

More information

02장.배열과 클래스

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

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

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

11강-힙정렬.ppt

11강-힙정렬.ppt 11 (Heap ort) leejaku@shinbiro.com Topics? Heap Heap Opeations UpHeap/Insert, DownHeap/Extract Binary Tree / Index Heap ort Heap ort 11.1 (Priority Queue) Operations ? Priority Queue? Priority Queue tack

More information

Chapter 4. LISTS

Chapter 4. LISTS 연결리스트의응용 류관희 충북대학교 1 체인연산 체인을역순으로만드는 (inverting) 연산 3 개의포인터를적절히이용하여제자리 (in place) 에서문제를해결 typedef struct listnode *listpointer; typedef struct listnode { char data; listpointer link; ; 2 체인연산 체인을역순으로만드는

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

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

슬라이드 1

슬라이드 1 C programming and Data Structures Overview T. H. Cormen, C. E. Leiserson and R. L. Rivest Introduction to, 3rd Edition, MIT Press, 2009 Sungkyunkwan University Hyunseung Choo choo@skku.edu Copyright 2000-2018

More information

학습목차 2.1 다차원배열이란 차원배열의주소와값의참조

학습목차 2.1 다차원배열이란 차원배열의주소와값의참조 - Part2- 제 2 장다차원배열이란무엇인가 학습목차 2.1 다차원배열이란 2. 2 2 차원배열의주소와값의참조 2.1 다차원배열이란 2.1 다차원배열이란 (1/14) 다차원배열 : 2 차원이상의배열을의미 1 차원배열과다차원배열의비교 1 차원배열 int array [12] 행 2 차원배열 int array [4][3] 행 열 3 차원배열 int array [2][2][3]

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

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

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

More information

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

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

More information

Chapter 4. LISTS

Chapter 4. LISTS 6. 동치관계 (Equivalence Relations) 동치관계 reflexive, symmetric, transitive 성질을만족 "equal to"(=) 관계는동치관계임. x = x x = y 이면 y = x x = y 이고 y = z 이면 x = z 동치관계를이용하여집합 S 를 동치클래스 로분할 동일한클래스내의원소 x, y 에대해서는 x y 관계성립

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

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

歯7장.PDF

歯7장.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

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

chap7.PDF

chap7.PDF 7 Hello!! C 2 . 3 ([] ) < > [ ]; int array[10]; < > [ ][ ]; int array [3] [5]; 4 < > [ ]={ x1,,x10} ( ); (,). ({}). : int array[10]={1,2,3,4,5,6,7,8,9,10}; (" "). : char array[7]="turbo-c"; 5 int array[2][3]={{1,2},{3,4},{5,6}};

More information

PowerPoint Template

PowerPoint Template 18 동적할당과고급처리 인터넷정보과 1 2/19 동적할당 목적 다음과같은일반변수의선언과사용은변수를정적 (static) 으로사용 int a = 10; 메모리사용예측이부정확한경우는충분한메모리를미리확보해야하는것은비효율 동적 (dynamic) 메모리할당 (Memory Allocation) 동적인메모리할당을위해서는함수 malloc() 을이용, 메모리공간을확보 함수 malloc()

More information

2002년 2학기 자료구조

2002년 2학기 자료구조 자료구조 (Data Structures) Chapter 1 Basic Concepts Overview : Data (1) Data vs Information (2) Data Linear list( 선형리스트 ) - Sequential list : - Linked list : Nonlinear list( 비선형리스트 ) - Tree : - Graph : (3)

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

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

Microsoft PowerPoint - Chapter_08.pptx

Microsoft PowerPoint - Chapter_08.pptx 프로그래밍 1 1 Chapter 8. Pointers May, 2016 Dept. of software Dankook University http://embedded.dankook.ac.kr/~baeksj 포인터의개념 (1/6) 2 포인터란 : 다른객체를가리키는변수 객체의메모리주소를저장하는변수 기호적방식 (symbolic way) 으로주소사용 포인터와관련된연산자

More information

Microsoft PowerPoint - 알고리즘_5주차_1차시.pptx

Microsoft PowerPoint - 알고리즘_5주차_1차시.pptx Basic Idea of External Sorting run 1 run 2 run 3 run 4 run 5 run 6 750 records 750 records 750 records 750 records 750 records 750 records run 1 run 2 run 3 1500 records 1500 records 1500 records run 1

More information

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600 균형이진탐색트리 -VL Tree delson, Velskii, Landis에의해 1962년에제안됨 VL trees are balanced n VL Tree is a binary search tree such that for every internal node v of T, the heights of the children of v can differ by at

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

C 언어 강의노트

C 언어 강의노트 C언어 (CSE2035) (15-1 Lists) Linear list 의구성, Insertion, deletion 윤용운, Ph.D. Dept. of Computer Science and Engineering Sogang University Seoul, Korea Tel: 010-3204-6811 Email : yuyoon0@sogang.ac.kr 2018-01-11

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

6.1 Addresses and Pointers Recall memory concepts from Ch2 ch6_testbasicpointer.c int x1=1, x2=7; double distance; int *p; int q=8; p = &q; name addre

6.1 Addresses and Pointers Recall memory concepts from Ch2 ch6_testbasicpointer.c int x1=1, x2=7; double distance; int *p; int q=8; p = &q; name addre GEN1031 Computer Programming Chapter 6 Pointer 포인터 Kichun Lee Department of Industrial Engineering Hanyang Univesity 1 6.1 Addresses and Pointers Recall memory concepts from Ch2 ch6_testbasicpointer.c

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

BMP 파일 처리

BMP 파일 처리 BMP 파일처리 김성영교수 금오공과대학교 컴퓨터공학과 학습내용 영상반전프로그램제작 2 Inverting images out = 255 - in 3 /* 이프로그램은 8bit gray-scale 영상을입력으로사용하여반전한후동일포맷의영상으로저장한다. */ #include #include #define WIDTHBYTES(bytes)

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

Lab 4. 실습문제 (Circular singly linked list)_해답.hwp

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

More information

컴파일러

컴파일러 YACC 응용예 Desktop Calculator 7/23 Lex 입력 수식문법을위한 lex 입력 : calc.l %{ #include calc.tab.h" %} %% [0-9]+ return(number) [ \t] \n return(0) \+ return('+') \* return('*'). { printf("'%c': illegal character\n",

More information

2007_2_project4

2007_2_project4 Programming Methodology Instructor: Kyuseok Shim Project #4: external sort with template Due Date: 0:0 a.m. between 2007-12-2 & 2007-12-3 Introduction 이프로젝트는 C++ 의 template을이용한 sorting algorithm과정렬해야할데이터의크기가

More information

Microsoft PowerPoint - a10.ppt [호환 모드]

Microsoft PowerPoint - a10.ppt [호환 모드] Structure Chapter 10: Structures t and Macros Structure 관련된변수들의그룹으로이루어진자료구조 template, pattern field structure를구성하는변수 (cf) C언어의 struct 프로그램의 structure 접근 entire structure 또는 individual fields Structure는

More information

Data Structure

Data Structure Function & Pointer C- 언어의활용을위한주요기법 (3) Dong Kyue Kim Hanyang University dqkim@hanyang.ac.kr 함수의인자전달 함수의인자전달 함수의인자전달방식 인자전달의기본방식은복사다. 함수호출시전달되는값을매개변수를통해서전달받는데, 이때에값의복사가일어난다. int main(void) int val = 10;

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

Microsoft PowerPoint - chap02-C프로그램시작하기.pptx

Microsoft PowerPoint - chap02-C프로그램시작하기.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 학습목표 을 작성하면서 C 프로그램의

More information

PowerPoint 프레젠테이션

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

More information

Infinity(∞) Strategy

Infinity(∞) Strategy 배열 (Array) 대용량데이터 대용량데이터를다루는기법 배열 (Array) 포인터 (Pointer) 구조체 (Structure) 파일 (File) 변수 (Variable) 변수및메모리할당 변수선언 : int imsi; imsi 4 Bytes 변수선언 : char imsi2; imsi2 1 Byte 배열 (Array) 배열 동일한데이터형을가지고있는데이터들을처리할때사용

More information

PowerPoint Presentation

PowerPoint Presentation Package Class 3 Heeseung Jo 목차 section 1 패키지개요와패키지의사용 section 2 java.lang 패키지의개요 section 3 Object 클래스 section 4 포장 (Wrapper) 클래스 section 5 문자열의개요 section 6 String 클래스 section 7 StringBuffer 클래스 section

More information

11장 포인터

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

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

설계란 무엇인가?

설계란 무엇인가? 금오공과대학교 C++ 프로그래밍 jhhwang@kumoh.ac.kr 컴퓨터공학과 황준하 6 강. 함수와배열, 포인터, 참조목차 함수와포인터 주소값의매개변수전달 주소의반환 함수와배열 배열의매개변수전달 함수와참조 참조에의한매개변수전달 참조의반환 프로그래밍연습 1 /15 6 강. 함수와배열, 포인터, 참조함수와포인터 C++ 매개변수전달방법 값에의한전달 : 변수값,

More information

슬라이드 1

슬라이드 1 정적메모리할당 (Static memory allocation) 일반적으로프로그램의실행에필요한메모리 ( 변수, 배열, 객체등 ) 는컴파일과정에서결정되고, 실행파일이메모리에로드될때할당되며, 종료후에반환됨 동적메모리할당 (Dynamic memory allocation) 프로그램의실행중에필요한메모리를할당받아사용하고, 사용이끝나면반환함 - 메모리를프로그램이직접관리해야함

More information

문서의 제목 나눔명조R, 40pt

문서의 제목  나눔명조R, 40pt 이문서는나눔글꼴로작성되었습니다. 설치하기 11차시 : 함수동적메모리할당다차원배열 프로그래밍및실험 제 11주 동국대학교조영석 6.6 함수인자로써의배열 - 함수정의에서배열로선언된형식매개변수는 pointer임. - 함수의인자로배열이전달되면배열의기본주소가 ( 배열의내용이아님 ) call-by-value로전달됨. - 배열원소는복사되지않음. 2 ( 예 ) #include

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

JVM 메모리구조

JVM 메모리구조 조명이정도면괜찮조! 주제 JVM 메모리구조 설미라자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조장. 최지성자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조원 이용열자료조사, 자료작성, PPT 작성, 보고서작성. 이윤경 자료조사, 자료작성, PPT작성, 보고서작성. 이수은 자료조사, 자료작성, PPT작성, 보고서작성. 발표일 2013. 05.

More information

Microsoft PowerPoint - chap06-2pointer.ppt

Microsoft PowerPoint - chap06-2pointer.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-2 참고자료 포인터 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 포인터의정의와사용 변수를선언하는것은메모리에기억공간을할당하는것이며할당된이후에는변수명으로그기억공간을사용한다. 할당된기억공간을사용하는방법에는변수명외에메모리의실제주소값을사용하는것이다.

More information

06장.리스트

06장.리스트 ---------------- DATA STRUCTURES USING C ---------------- CHAPTER 리스트 1/28 리스트란? 리스트 (list), 선형리스트 (linear list) 순서를가진항목들의모임 집합 : 항목간의순서의개념이없음 리스트의예 요일 : ( 일요일, 월요일,, 토요일 ) 한글자음의모임 : ( ㄱ, ㄴ,, ㅎ ) 카드 :

More information

5.스택(강의자료).key

5.스택(강의자료).key CHP 5: https://www.youtube.com/watch?v=ns-r91557ds ? (stack): (LIFO:Last-In First-Out):. D C B C B C B C B (element) C (top) B (bottom) (DT) : n element : create() ::=. is_empty(s) ::=. is_full(s) ::=.

More information

chap x: G입력

chap x: G입력 원형큐 (Circular Queue) [2] [3] [2] [3] [1] [4] [1] [4] [0] [5] front = 0, rear = 0 [2] [3] [0] [5] front = 0, rear = 3 [1] [4] [0] [5] front = 0, rear = 0 최대큐이용률 = MAX_Q_SIZE 1 3 장. 스택과큐 (Page 13) 원형큐의구현

More information

슬라이드 1

슬라이드 1 / 유닉스시스템개요 / 파일 / 프로세스 01 File Descriptor file file descriptor file type unix 에서의파일은단지바이트들의나열임 operating system 은파일에어떤포맷도부과하지않음 파일의내용은바이트단위로주소를줄수있음 file descriptor 는 0 이나양수임 file 은 open 이나 creat 로 file

More information

슬라이드 1

슬라이드 1 Array, Structure, and Pointer 2019 SANGJI University Kwang-Man Ko () 배열 (array) 이란? 같은형의변수를여러개만드는경우에사용 int A0, A1, A2, A3,,A9; int A[10]; 0 1 2 3 4 5 6 7 8 9 반복코드등에서배열을사용하면효율적인프로그래밍이가능 예 ) 최대값을구하는프로그램

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

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CC0E7B0EDB0FCB8AE5C53746F636B5F4D616E D656E74732E637070>

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CC0E7B0EDB0FCB8AE5C53746F636B5F4D616E D656E74732E637070> 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include "QuickSort.h" 7 using namespace std; 8 9 10 Node* Queue[100]; // 추가입력된데이터를저장하기위한 Queue

More information

Chapter #01 Subject

Chapter #01  Subject Device Driver March 24, 2004 Kim, ki-hyeon 목차 1. 인터럽트처리복습 1. 인터럽트복습 입력검출방법 인터럽트방식, 폴링 (polling) 방식 인터럽트서비스등록함수 ( 커널에등록 ) int request_irq(unsigned int irq, void(*handler)(int,void*,struct pt_regs*), unsigned

More information

Microsoft PowerPoint - chap06-5 [호환 모드]

Microsoft PowerPoint - chap06-5 [호환 모드] 2011-1 학기프로그래밍입문 (1) chapter 06-5 참고자료 변수의영역과데이터의전달 박종혁 Tel: 970-6702 Email: jhpark1@seoultech.ac.kr h k 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- ehanbit.net 자동변수 지금까지하나의함수안에서선언한변수는자동변수이다. 사용범위는하나의함수내부이다. 생존기간은함수가호출되어실행되는동안이다.

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

Frama-C/JESSIS 사용법 소개

Frama-C/JESSIS 사용법 소개 Frama-C 프로그램검증시스템소개 박종현 @ POSTECH PL Frama-C? C 프로그램대상정적분석도구 플러그인구조 JESSIE Wp Aorai Frama-C 커널 2 ROSAEC 2011 동계워크샵 @ 통영 JESSIE? Frama-C 연역검증플러그인 프로그램분석 검증조건추출 증명 Hoare 논리에기초한프로그램검증도구 사용법 $ frama-c jessie

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

hlogin2

hlogin2 0x02. Stack Corruption off-limit Kernel Stack libc Heap BSS Data Code off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code : off-limit Kernel Kernel : OS

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 KeyPad Device Control - Device driver Jo, Heeseung HBE-SM5-S4210 에는 16 개의 Tack Switch 를사용하여 4 행 4 열의 Keypad 가장착 4x4 Keypad 2 KeyPad 를제어하기위하여 FPGA 내부에 KeyPad controller 가구현 KeyPad controller 16bit 로구성된

More information

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070>

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070> #include "stdafx.h" #include "Huffman.h" 1 /* 비트의부분을뽑아내는함수 */ unsigned HF::bits(unsigned x, int k, int j) return (x >> k) & ~(~0

More information

Microsoft PowerPoint - 06-Pointer and Memory.pptx

Microsoft PowerPoint - 06-Pointer and Memory.pptx Development of Fashion CAD System 6. Pointer and Memory Sungmin Kim SEOUL NATIONAL UNIVERSITY Pointer and Memory Topics 포인터 변수와 포인터의 의미 Pass-by-Value 와 Pass-by-Reference 메모리 포인터와 배열 고정된 크기의 배열 정의 크기가 변하는

More information

Microsoft Word - FunctionCall

Microsoft Word - FunctionCall Function all Mechanism /* Simple Program */ #define get_int() IN KEYOARD #define put_int(val) LD A val \ OUT MONITOR int add_two(int a, int b) { int tmp; tmp = a+b; return tmp; } local auto variable stack

More information

C언어 및 실습 C Language and Practice

C언어 및 실습  C Language and Practice C언어 및 실습 C Language and Practice Chap. 2 : 변수의 영역 동국대학교 멀티미디어공학과 Young-Sik Jeong C 언어메모리구조 지역변수들이저장되는곳. 정확히는지역변수와그에따른환경이같이저장된다. 복귀주소와호출함수의환경이저장된다. 동적기억장소를위한공간. 프로그램이실행되는중간에필요에의해서할당받는메모리영역을통칭한다. 크기가정해져있지않고유동적이다.

More information

Microsoft PowerPoint - [2009] 02.pptx

Microsoft PowerPoint - [2009] 02.pptx 원시데이터유형과연산 원시데이터유형과연산 원시데이터유형과연산 숫자데이터유형 - 숫자데이터유형 원시데이터유형과연산 표준입출력함수 - printf 문 가장기본적인출력함수. (stdio.h) 문법 ) printf( Test printf. a = %d \n, a); printf( %d, %f, %c \n, a, b, c); #include #include

More information

C++ Programming

C++ Programming C++ Programming 연산자다중정의 Seo, Doo-okok clickseo@gmail.com http://www.clickseo.com 목 차 연산자다중정의 C++ 스타일의문자열 2 연산자다중정의 연산자다중정의 단항연산자다중정의 이항연산자다중정의 cin, cout 그리고 endl C++ 스타일의문자열 3 연산자다중정의 연산자다중정의 (Operator

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Programming Languages 모듈과펑터 2016 년봄학기 손시운 (ssw5176@kangwon.ac.kr) 담당교수 : 임현승교수님 모듈 (module) 관련있는정의 ( 변수또는함수 ) 를하나로묶은패키지 예약어 module과 struct end를사용하여정의 아래는모듈의예시 ( 우선순위큐, priority queue) # module PrioQueue

More information

슬라이드 1

슬라이드 1 3 장. 선행자료 어휘원소, 연산자와 C 시스템 박종혁교수 UCS Lab Tel: 970-6702 Email: jhpark1@seoultech.ac.kr SeoulTech 2019-1 st 프로그래밍입문 (1) 2 목차 1.1 문자와어휘원소 1.2 구문법칙 1.3 주석 1.4 키워드 (Keyword) 1.5 식별자 (Identifier) 1.6 상수 (Integer,

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

슬라이드 1

슬라이드 1 UNIT 6 배열 로봇 SW 교육원 3 기 학습목표 2 배열을사용핛수있다. 배열 3 배열 (Array) 이란? 같은타입 ( 자료형 ) 의여러변수를하나의묶음으로다루는것을배열이라고함 같은타입의많은양의데이터를다룰때효과적임 // 학생 30 명의점수를저장하기위해.. int student_score1; int student_score2; int student_score3;...

More information

Microsoft PowerPoint - chap06-1Array.ppt

Microsoft PowerPoint - chap06-1Array.ppt 2010-1 학기프로그래밍입문 (1) chapter 06-1 참고자료 배열 박종혁 Tel: 970-6702 Email: jhpark1@snut.ac.kr 한빛미디어 출처 : 뇌를자극하는 C프로그래밍, 한빛미디어 -1- 배열의선언과사용 같은형태의자료형이많이필요할때배열을사용하면효과적이다. 배열의선언 배열의사용 배열과반복문 배열의초기화 유연성있게배열다루기 한빛미디어

More information