Software Engineering

Size: px
Start display at page:

Download "Software Engineering"

Transcription

1 8. 코딩스타일 Software Engineering

2 옷을입는것에도스타일이있다. 빨간색을좋아하는사람 빨갱이인가? 진바지를좋아하는사람 청바지가잘어울리는사람 코딩스타일? 프로그램에도스타일이있다? 정수형은사용하지않는사람 모름지기수란모두실수여 ~ 다섯줄만넘으면함수로분리하는사람 모듈화안배웠어 ~ 나눠! 나눠! 나눠! 포인터를엄청많이사용하는사람 난포인터의황제다 어렵지 ~ 나만알면장땡 ~ 어떤스타일이가장좋은가? 원칙은없다. 다만권고 (recommendation) 가있을뿐

3 스타일 1: 명확하게작성하라. (1/3) 부제 : 너무똑똑한체하지말것 내가가장하기어려운 int i, j; float v[n][n];... for(i=1;i <= N;i++) for(j=1;j <= N;j++) int i, j; float v[n][n]; v[i-1][j-1] = (i/j)*(j/i); for(i=0;i < N;i++) for(j=0;j < N;j++) if(i == j) v[i][j] = 1; else v[i][j] = 0;

4 스타일 1: 명확하게작성하라. (2/3) 일반적으로짧을수록명확해진다. power[1] = base; power[2] = base*base; power[3] = base*base*base; power[4] = base*base*base*base; power[5] = base*base*base*base*base; power[6] = base*base*base*base*base*base; power[7] = base*base*base*base*base*base*base; power[8] = base*base*base*base*base*base*base*base;... power[1] = base; for(i=2;i < N;i++) power[i] = power[i-1]*base;

5 스타일 1: 명확하게작성하라. (3/3) 짧으면항시명확하다? 꼭그렇지만은않다. int IntegerFromHex(char HexDigit) { if(hexdigit < 58) return(hexdigit 48); // 0 = 48 else return(hexdigit 55); // A = 65 } int IntegerFromHex(char HexDigit) { switch(hexdigit) { case 0 : return 0; break; case 1 : return 1; break;... case 9 : return 9; break; case A : return 10; break;... case F : return 15; break; } } Page 5

6 스타일 2: 간결하고직접적으로표현하라. (1/2) 최소값을구하는예제 (x = y, or y = x 인경우, 바른값을찾지못한다. if(x < y) { if(x < z) small = x; if(x > z) small = z; } if(x > y) { if(y < z) small = y; if(y > z) small = z; } small = x; if(y < small) small = y; if(z < small) small = z; Page 6

7 스타일 2: 간결하고직접적으로표현하라. (1/2) If-then-else 에서는짧은선택구조를먼저기술한다. if(in_user_code) { in_user_code = FALSE; r2 = r; reset_pharlap(); send_sig_segv(); } else revert(); if(!in_user_code) revert(); else { in_user_code = FALSE; r2 = r; reset_pharlap(); send_sig_segv(); }

8 스타일 3: 임시변수사용을피하라. 임시변수 (temporary variable) 의사용은가급적피한다. t1 = x1 (x2 + x2); t2 = 7 x2; Y = t1 + t1 + t2 + t2; y = 2*(x1 2*x2) + 2*(7 x2); y = 2 x 2x x ; ( ) ( ) 1 2 2

9 스타일 4: 혼돈을초래치않는변수명을사용하라. 혼돈하기쉬운글자들의예 1 과 l a1 al 0 과 O term0 termo 5 와 S TEXT5 TEXTS I 와 l Iist list m 과 n 의연속사용 mnnm mnmn u 와 v 의연속사용 vuvu uuvu 변수수정의예제 positionx, positiony xpos, ypos n, nn, nnn n, nsq, ncube nunit, nsqur, ncube

10 스타일 5: 일관성있는변수명을사용하라. Hungarian notation: 변수이름의처음몇자는변수의타입이나범위를나타내도록한다. 예 ) ptr_to_date_key ( 포인터 ) 일관성있는이름을사용한다. char buffer[500], mssge[80]; void read_instance(void), SaveCurrent(void); void get_line(void), write_line(void); int index1, index2; char buffer[500], message[80]; void read_instance(void), save_current(void); void read_line(void), write_line(void) int i, j;

11 스타일 6: 문장그룹이명확하도록 { } 와들여쓰기를사용하라. for(i=0;i < N;i++) { k = a[i]; if(k>100) a[i] = i*3; else if(j ==N)... } for(i=0;i < N;i++) { k = a[i]; if(k > 100) a[i] = i * 3; else if(j == N)... }

12 스타일 7: 한가지선택이면 if 만, 두가지이면 if-else if(swctl == 1 ) goto conti; else { dvictl += 10; swctl = 1 ; } conti; if(swctl!= 1 ) { dvictl += 10; swctl = 1 ; }

13 스타일 8: if 다음의 if 구조, null else 는피한다. if 다음의 if 나 null else 는가독성을크게떨어뜨리며, 오해의소지가있다. if(qty > 10) if(qty > 200) if(qty >= 500) bill_a += 1.00; else bill_a += 0.50; else; else bill_a = 0.0; // A // B // C // C // B // A if(qty >= 500.0) bill_a += 1.00; if(qty < 500 && qty > 200) bill_a += 0.5; if(qty <= 10) bill_a = 0.0;

14 스타일 9: 문장의반복은최소화한다. 반복되는문장은가급적반복문을사용하여제거한다. tkn = get_token(); if(tkn == T_END) return; If(tkn == T_START) start_proc(); while(ntokens < T_LIMIT) { process_token(); add_token(); tkn = get_token(); if(tkn == T_END) return; if(tkn == T_START) start_proc(); } for(;;) { tkn = get_token(); if(tkn == T_END) return; if(tkn == T_START) start_proc(); if(ntokens >= T_LIMIT) break; process_token(); add_token(); } Page 14

15 스타일 10: 모듈화하라. 서브루틴을사용하라. 같은역할을하는문장들인경우에는 Grouping 하여모듈화한다. 반복되는기능에대해서는함수로분리한다. Page 15

16 그밖의원칙들 (1/4) 수식표현 명료하게작성하라 - 효율성을위하여명료함을희생하지않도록한다. 번거로운일은기계가하도록만들라. 괄호를사용하여모호성을제거하라. 언어의좋은기능을이용하고불안한기능의사용은피하라. 제어구조 위에서아래로읽을수있도록프로그래밍하라. 중복구조를최소화하라. 맨처음작성한것으로끝나지말고, 계속해서리뷰하라.

17 그밖의원칙들 (2/4) 프로그램 각모듈은분명한한가지역할만수행하도록하라. 잘못작성된코드는짜맞추려하지하지말고다시작성하라. 차리리버리고, 처음부터다시 큰프로그램은작은단위로나누어따로작성하고따로검사하라. 입출력 자료가한계값을벗어나지않는지항상검사하라. 입력형식은사용자가쉽게준비할수있게하고출력형식은그모양이스스로드러나게구성하라. 입출력은따로모아서독립된서브루틴으로만들라.

18 그밖의원칙들 (3/4) 기타 발견된오류만고치지말고, 전체적으로보고수정가능한모든오류를고친다. 하나차이에의한오류 (off-by-one) 를주의하라. 프로그램을방어적으로작성하라. 빠른프로그램보다먼저바른프로그램을작성하라. 빠른프로그램보다먼저명료한프로그램을작성하라. 간결함을유지하면서빠른프로그램을만들라.

19 그밖의원칙들 (4/4) 기타 ( 계속 ) 주석과코드가일치하는지확인하라. 주석을달때코드를되풀이해서는않도록한다. 잘못된코드에는주석을달지않는다. -- 다시작성한다. 과다하게주석을달지않는다. 덕지덕지고쳐서사용하려고애쓰지않는다. -- 과감히버리고새로작성한다.

20 프로그램에관한몇가지격언 (1/2) The sooner you start to code, the longer the program will take. ( 코딩을일찍시작하면할수록, 프로그래밍에시간이많이걸린다.) If you can't write it down in English, you can't code it. ( 글로써표현할수없다면, 코딩도할수없다.) If the code and the comments disagree, then both are probably wrong. ( 코드와주석이맞지않으면, 둘다잘못되었을가능성이높다.) If you have too many special cases, you are doing it wrong. ( 너무많은예외케이스가있다면, 뭔가잘못하고있는것이다.) Get your data structures correct first, and the rest of the program will write itself. ( 먼저자료구조를잘잡는다면, 프로그램은저절로써지게될것이다.)

21 프로그램에관한몇가지격언 (1/2) Don't debug standing up. It cuts your patience in half. ( 서서디버깅하지말아라. 참을성을가지란이야기 ) Each new user of a new system uncovers a new class bugs. ( 새로운시스템에대한새로운사용자는항시새로운종류의버그를발견한다.) (Naïve user는유익한테스트결과를가져올것이고, 새롭게 porting하면항시문제점이생길것임을명심하란이야기 ) Whenever possible, steal code. ( 가능하다면코드를훔쳐라. 즉, 코드를재사용하라.) Always do the hard part first. If the hard part is impossible, why waste time on the easy part? ( 어려운부분을먼저하라. 어려운부분이불가 능하다면, 쉬운부분을해서뭣하나?)

22 코드의문서화 Software Engineering

23 코드의문서화 소스코드의문서화는즉, 주석쓰는것을의미한다. 주석의종류 프로그램헤더 : 전체프로그램의기능을설명하는주석 모듈헤더 ( 함수헤더 ): 해당모듈의기능을설명하는주석 각줄에삽입된주석 : 해당줄을설명하는주석

24 프로그램헤더주석 프로그램의제목 제작자 작성일과버전번호 구조와설계 공유변수 사용되는파일 외부참조파일

25 프로그램헤더주석의예제 (1/2) /***************************************************************************** **** - EXAM SCORE SUMMARY PROGRAM - WRITTEN BY : HONG, KIL DONG - RELEASE DATE : April 1, PURPOSE : This program produces a variety of statistics on a - group of student's exam scores. For each score that is entered, - the score and a row of stars representing the magnitute of the - score is printed out. In addition, the number of scores, the - average score, the highest score and the lowest score are - printed out. - - DESIGN : The program is composed of the following modules: - Main module - The Main, controlling module - Validate Input - Gets and validates the user's input - Process Valid Score - Prints score and row of stars for one score - Update Statistics - Updates global statistics - Print Summary Report - Prints summary statistics

26 프로그램헤더주석의예제 (2/2) - MAJOR VARIABLES : - SumOfScore (subrange of integer, ) - - The sum of all score entered - NumOfStudents (subrange of integer, ) - - The total number of score entered - LargestScore (subrange of integer, 0..20) - - The largest score in the set of scores - SmallestScore (subrange of integer, 0..20) - - The smallest score - FILES USED: - Input - contains integer scores, one to a line - Output - contains a one-line histogram for each score - read, followed on the next line by the number of - students and their average score, then on the next line - by the top score, and concluding on the next line with - the lowest score. - EXTERNAL REFERENCES: None ***********************************************************************/

27 코딩표준 (1/2) [ISO/IEC 9899] Software Engineering

28 코딩표준 (2/2) [JAVA] Software Engineering

29 연습문제 1. 소프트웨어개발방법론에서구현에대해설명하라.. 2. 코딩스타일 (Coding Style) 과코딩표준 (Coding Standard) 의차이점은무엇인가? Software Engineering

소프트웨어공학

소프트웨어공학 2 3 Weinberg LOC 1 4 2 5 5 1 5 2-3 3 2 3 4 2 5 1 2-3 4 3 4 1 1: 5: 4 - - Documentation vs. 5 1 ( ), 2 FORTRAN, COBOL, ALGOL60, BASIC 3 : Pascal, Modula-2, C, Ada, C++, Java : CHILL, RPG, Lisp, Prolog,

More information

Microsoft PowerPoint 구현.pptx

Microsoft PowerPoint 구현.pptx 소프트웨어공학 () 문양세강원대학교 IT대학컴퓨터과학전공 In this chapter (1/2) 구현, 즉코딩 (coding) 은 설계된내용을원시코드 (source code) 로변환시키는작업 설계사양 (design spec.) 코딩 원시코드 (source code) 컴파일디버깅 목적코드 (object code) 코딩의원칙 설계내용을철저히반영시킨다. ( 어렵다고빼고진행하면나중에후회

More information

Microsoft PowerPoint 구현.ppt

Microsoft PowerPoint 구현.ppt 소프트웨어공학 () 2005 년가을학기 문양세컴퓨터과학과강원대학교자연과학대학 In this chapter (1/2) 구현, 즉코딩 (coding) 은 설계된내용을원시코드 (source code) 로변환시키는작업 설계사양 (design spec.) 코딩 원시코드 (source code) 컴파일디버깅 목적코드 (object code) 코딩의원칙 설계내용을철저히반영시킨다.

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

C프로-3장c03逞풚

C프로-3장c03逞풚 C h a p t e r 03 C++ 3 1 9 4 3 break continue 2 110 if if else if else switch 1 if if if 3 1 1 if 2 2 3 if if 1 2 111 01 #include 02 using namespace std; 03 void main( ) 04 { 05 int x; 06 07

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

Chapter_06

Chapter_06 프로그래밍 1 1 Chapter 6. Functions and Program Structure April, 2016 Dept. of software Dankook University http://embedded.dankook.ac.kr/~baeksj 이장의강의목표 2 문자의입력방법을이해한다. 중첩된 if문을이해한다. while 반복문의사용법을익힌다. do 반복문의사용법을익힌다.

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

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 - 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

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

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 언어 프로그래밊 과제 풀이

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

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

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

歯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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 06 반복문 01 반복문의필요성 02 for문 03 while문 04 do~while문 05 기타제어문 반복문의의미와필요성을이해한다. 대표적인반복문인 for 문, while 문, do~while 문의작성법을 알아본다. 1.1 반복문의필요성 반복문 동일한내용을반복하거나일정한규칙으로반복하는일을수행할때사용 프로그램을좀더간결하고실제적으로작성할수있음.

More information

중간고사

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

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

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

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for

example code are examined in this stage The low pressure pressurizer reactor trip module of the Plant Protection System was programmed as subject for 2003 Development of the Software Generation Method using Model Driven Software Engineering Tool,,,,, Hoon-Seon Chang, Jae-Cheon Jung, Jae-Hack Kim Hee-Hwan Han, Do-Yeon Kim, Young-Woo Chang Wang Sik, Moon

More information

Infinity(∞) Strategy

Infinity(∞) Strategy 반복제어 표월성 passwd74@cherub.sungkyul.edu 개요 for() 문 break문과 continue문 while문 do-while문 for() 문 for() 문형식 for( 표현식1; 표현식2; 표현식3) 여러문장들 ; 표현식 1 : 초기화 (1 번만수행 ) 표현식 2 : 반복문수행조건 ( 없으면무한반복 ) 표현식 3 : 반복문수행횟수 for()

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

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

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다. Eclipse 개발환경에서 WindowBuilder 를이용한 Java 프로그램개발 이예는 Java 프로그램의기초를이해하고있는사람을대상으로 Embedded Microcomputer 를이용한제어시스템을 PC 에서 Serial 통신으로제어 (Graphical User Interface (GUI) 환경에서 ) 하는프로그램개발예를설명한다. WindowBuilder:

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

윈도우즈프로그래밍(1)

윈도우즈프로그래밍(1) 제어문 (2) For~Next 문 윈도우즈프로그래밍 (1) ( 신흥대학교컴퓨터정보계열 ) 2/17 Contents 학습목표 프로그램에서주어진특정문장을부분을일정횟수만큼반복해서실행하는문장으로 For~Next 문등의구조를이해하고활용할수있다. 내용 For~Next 문 다중 For 문 3/17 제어문 - FOR 문 반복문 : 프로그램에서주어진특정문장들을일정한횟수만큼반복해서실행하는문장

More information

untitled

untitled Push... 2 Push... 4 Push... 5 Push... 13 Push... 15 1 FORCS Co., LTD A Leader of Enterprise e-business Solution Push (Daemon ), Push Push Observer. Push., Observer. Session. Thread Thread. Observer ID.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Chapter 08 함수 01 함수의개요 02 함수사용하기 03 함수와배열 04 재귀함수 함수의필요성을인식한다. 함수를정의, 선언, 호출하는방법을알아본다. 배열을함수의인자로전달하는방법과사용시장점을알아본다. 재귀호출로해결할수있는문제의특징과해결방법을알아본다. 1.1 함수의정의와기능 함수 (function) 특별한기능을수행하는것 여러가지함수의예 Page 4 1.2

More information

슬라이드 1

슬라이드 1 마이크로컨트롤러 2 (MicroController2) 2 강 ATmega128 의 external interrupt 이귀형교수님 학습목표 interrupt 란무엇인가? 기본개념을알아본다. interrupt 중에서가장사용하기쉬운 external interrupt 의사용방법을학습한다. 1. Interrupt 는왜필요할까? 함수동작을추가하여실행시키려면? //***

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

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 - chap01-C언어개요.pptx

Microsoft PowerPoint - chap01-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 학습목표 프로그래밍의 기본 개념을

More information

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20B8AEB4AABDBA20BFC0B7F920C3B3B8AEC7CFB1E22E BC8A3C8AF20B8F0B5E55D> 리눅스 오류처리하기 2007. 11. 28 안효창 라이브러리함수의오류번호얻기 errno 변수기능오류번호를저장한다. 기본형 extern int errno; 헤더파일 라이브러리함수호출에실패했을때함수예 정수값을반환하는함수 -1 반환 open 함수 포인터를반환하는함수 NULL 반환 fopen 함수 2 유닉스 / 리눅스 라이브러리함수의오류번호얻기 19-1

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

APOGEE Insight_KR_Base_3P11

APOGEE Insight_KR_Base_3P11 Technical Specification Sheet Document No. 149-332P25 September, 2010 Insight 3.11 Base Workstation 그림 1. Insight Base 메인메뉴 Insight Base Insight Insight Base, Insight Base Insight Base Insight Windows

More information

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

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

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

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

ePapyrus PDF Document

ePapyrus PDF Document 프로그래밍 콘테스트 챌린징 for GCJ, TopCoder, ACM/ICPC, KOI/IOI 지은이 Takuya Akiba, Yoichi Iwata, Mastoshi Kitagawa 옮긴이 박건태, 김승엽 1판 1쇄 발행일 201 1년 10월 24일 펴낸이 장미경 펴낸곳 로드북 편집 임성춘 디자인 이호용(표지), 박진희(본문) 주소 서울시 관악구 신림동 1451-15

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Verilog: Finite State Machines CSED311 Lab03 Joonsung Kim, joonsung90@postech.ac.kr Finite State Machines Digital system design 시간에배운것과같습니다. Moore / Mealy machines Verilog 를이용해서어떻게구현할까? 2 Finite State

More information

PowerPoint Presentation

PowerPoint Presentation #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

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

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

6주차.key

6주차.key 6, Process concept A program in execution Program code PCB (process control block) Program counter, registers, etc. Stack Heap Data section => global variable Process in memory Process state New Running

More information

<4D F736F F F696E74202D20C1A63036C0E520BCB1C5C3B0FA20B9DDBAB928B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63036C0E520BCB1C5C3B0FA20B9DDBAB928B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 6 장선택과반복 이번장에서학습할내용 조건문이란? if 문 if, else 문 중첩 if 문 switch 문 break문 continue문 지금까지는문장들이순차적으로실행된다고하였다. 하지만필요에따라서조건이만족되면문장의실행순서를변경할수있는기능이제공된다. 3 가지의제어구조 조건문 문장이실행되는순서에영향을주는문장 조건에따라서여러개의실행경로가운데하나를선택

More information

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C4C656D70656C2D5A69762E637070>

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C4C656D70656C2D5A69762E637070> /* */ /* LZWIN.C : Lempel-Ziv compression using Sliding Window */ /* */ #include "stdafx.h" #include "Lempel-Ziv.h" 1 /* 큐를초기화 */ void LZ::init_queue(void) front = rear = 0; /* 큐가꽉찼으면 1 을되돌림 */ int LZ::queue_full(void)

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++-¿Ïº®Çؼ³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

<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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 5 2004. 3. . 5.. Input. Output . 5 2004 7,, 1,000 5,. 40 2004.7 2005.7 2006.7 2007.7 2008.7 2011. 1,000 300 100 50 20 20 ( ) 0.01% 0.08% 0.36% 0.96% 3.07% 100% ( ) 5.3%(10.7%) 12.2%(17.3%) 21.9%(26.4%)

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

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

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

Chap 6: Graphs

Chap 6: Graphs 5. 작업네트워크 (Activity Networks) 작업 (Activity) 부분프로젝트 (divide and conquer) 각각의작업들이완료되어야전체프로젝트가성공적으로완료 두가지종류의네트워크 Activity on Vertex (AOV) Networks Activity on Edge (AOE) Networks 6 장. 그래프 (Page 1) 5.1 AOV

More information

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

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

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Reasons for Poor Performance Programs 60% Design 20% System 2.5% Database 17.5% Source: ORACLE Performance Tuning 1 SMS TOOL DBA Monitoring TOOL Administration TOOL Performance Insight Backup SQL TUNING

More information

OCW_C언어 기초

OCW_C언어 기초 초보프로그래머를위한 C 언어기초 2 장 : C 프로그램시작하기 2012 년 이은주 학습목표 을작성하면서 C 프로그램의구성요소 주석 (comment) 이란무엇인지알아보고, 주석을만드는방법 함수란무엇인지알아보고, C 프로그램에반드시필요한 main 함수 C 프로그램에서출력에사용되는 printf 함수 변수의개념과변수의값을입력받는데사용되는 scanf 함수 2 목차 프로그램코드

More information

09-interface.key

09-interface.key 9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1

More information

adfasdfasfdasfasfadf

adfasdfasfdasfasfadf C 4.5 Source code Pt.3 ISL / 강한솔 2019-04-10 Index Tree structure Build.h Tree.h St-thresh.h 2 Tree structure *Concpets : Node, Branch, Leaf, Subtree, Attribute, Attribute Value, Class Play, Don't Play.

More information

Microsoft Word - [TP_3][T1]UTP.docx

Microsoft Word - [TP_3][T1]UTP.docx Unit Testing Plan for Point Of Sale System Test Plan Test Design Specification Test Cases Specification Project Team Team 1 Date 2017-11-03 Team Information 201211337 김재현 201112052 방민석 201312259 백만일 201211383

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

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

Let G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a set of E, possibly empty, that is includ

Let G = (V, E) be a connected, undirected graph with a real-valued weight function w defined on E. Let A be a set of E, possibly empty, that is includ 알고리즘설계와분석 (CSE3081(2 반 )) 기말고사 (2016년 12월15일 ( 목 ) 오전 9시40분 ~) 담당교수 : 서강대학교컴퓨터공학과임인성 < 주의 > 답안지에답을쓴후제출할것. 만약공간이부족하면답안지의뒷면을이용하고, 반드시답을쓰는칸에어느쪽의뒷면에답을기술하였는지명시할것. 연습지는수거하지않음. function MakeSet(x) { x.parent

More information

<C6F7C6AEB6F5B1B3C0E72E687770>

<C6F7C6AEB6F5B1B3C0E72E687770> 1-1. 포트란 언어의 역사 1 1-2. 포트란 언어의 실행 단계 1 1-3. 문제해결의 순서 2 1-4. Overview of Fortran 2 1-5. Use of Columns in Fortran 3 1-6. INTEGER, REAL, and CHARACTER Data Types 4 1-7. Arithmetic Expressions 4 1-8. 포트란에서의

More information

목차 배열의개요 배열사용하기 다차원배열 배열을이용한문자열다루기 실무응용예제 C 2

목차 배열의개요 배열사용하기 다차원배열 배열을이용한문자열다루기 실무응용예제 C 2 제 7 장. 배열 목차 배열의개요 배열사용하기 다차원배열 배열을이용한문자열다루기 실무응용예제 C 2 배열의개요 배열 (array) 의정의 같은데이터형을가지는여러개의변수를하나의배열명으로공유 기억공간을순차적으로할당받아사용하는것 [ 7.1] C 3 배열의개요 배열 (array) 의필요성 같은데이터형의여러개의변수간결하게선언 기억공간을순차적으로변수의값들을저장, 관리

More information

2015 개정교육과정에따른정보과평가기준개발연구 연구책임자 공동연구자 연구협력관

2015 개정교육과정에따른정보과평가기준개발연구 연구책임자 공동연구자 연구협력관 2015 개정교육과정에따른정보과평가기준개발연구 연구책임자 공동연구자 연구협력관 2015 개정교육과정에따른정보과평가기준개발연구 연구협력진 머리말 연구요약 차례 Ⅰ 서론 1 Ⅱ 평가준거성취기준, 평가기준, 성취수준, 예시평가도구개발방향 7 Ⅲ 정보과평가준거성취기준, 평가기준, 성취수준, 예시평가도구의개발 25 Ⅳ 정보과평가준거성취기준, 평가기준, 성취수준, 예시평가도구의활용방안

More information

슬라이드 1

슬라이드 1 Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치

More information

C 프로그램의 기본

C 프로그램의 기본 C 프로그램의기본 목차 C 프로그램의구성요소 주석 main 함수 출력 C 언어의입력과출력 변수 printf 함수 scanf 함수 2 예제 2-1 : 첫번째 C 프로그램 3 2.1.1 주석 주석의용도 프로그램에대한설명 프로그램전체에대한대략적인정보를제공 프로그램수행에영향을미치지않는요소 4 2.1.1 주석 주석사용방법 /* 과 */ 을이용한여러줄주석 // 을이용한한줄주석

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

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

SRC PLUS 제어기 MANUAL

SRC PLUS 제어기 MANUAL ,,,, DE FIN E I N T R E A L L O C E N D SU B E N D S U B M O TIO

More information

http://cafedaumnet/pway Chapter 1 Chapter 2 21 printf("this is my first program\n"); printf("\n"); printf("-------------------------\n"); printf("this is my second program\n"); printf("-------------------------\n");

More information

본 강의에 들어가기 전

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

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

슬라이드 1

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

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

USER GUIDE

USER GUIDE Solution Package Volume II DATABASE MIGRATION 2010. 1. 9. U.Tu System 1 U.Tu System SeeMAGMA SYSTEM 차 례 1. INPUT & OUTPUT DATABASE LAYOUT...2 2. IPO 중 VB DATA DEFINE 자동작성...4 3. DATABASE UNLOAD...6 4.

More information

untitled

untitled 시스템소프트웨어 : 운영체제, 컴파일러, 어셈블러, 링커, 로더, 프로그래밍도구등 소프트웨어 응용소프트웨어 : 워드프로세서, 스프레드쉬트, 그래픽프로그램, 미디어재생기등 1 n ( x + x +... + ) 1 2 x n 00001111 10111111 01000101 11111000 00001111 10111111 01001101 11111000

More information

Microsoft PowerPoint - polling.pptx

Microsoft PowerPoint - polling.pptx 지현석 (binish@home.cnu.ac.kr) http://binish.or.kr Index 이슈화된키보드해킹 최근키보드해킹이슈의배경지식 Interrupt VS polling What is polling? Polling pseudo code Polling 을이용한키로거분석 방어기법연구 이슈화된키보드해킹 키보드해킹은연일상한가! 주식, 펀드투자의시기?! 최근키보드해킹이슈의배경지식

More information

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2

비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 비트연산자 1 1 비트와바이트 비트와바이트 비트 (Bit) : 2진수값하나 (0 또는 1) 를저장할수있는최소메모리공간 1비트 2비트 3비트... n비트 2^1 = 2개 2^2 = 4개 2^3 = 8개... 2^n 개 1 바이트는 8 비트 2 2 진수법! 2, 10, 16, 8! 2 : 0~1 ( )! 10 : 0~9 ( )! 16 : 0~9, 9 a, b,

More information

<32B1B3BDC32E687770>

<32B1B3BDC32E687770> 008년도 상반기 제회 한 국 어 능 력 시 험 The th Test of Proficiency in Korean 일반 한국어(S-TOPIK 중급(Intermediate A 교시 이해 ( 듣기, 읽기 수험번호(Registration No. 이 름 (Name 한국어(Korean 영 어(English 유 의 사 항 Information. 시험 시작 지시가 있을

More information

17장 클래스와 메소드

17장 클래스와 메소드 17 장클래스와메소드 박창이 서울시립대학교통계학과 박창이 ( 서울시립대학교통계학과 ) 17 장클래스와메소드 1 / 18 학습내용 객체지향특징들객체출력 init 메소드 str 메소드연산자재정의타입기반의버전다형성 (polymorphism) 박창이 ( 서울시립대학교통계학과 ) 17 장클래스와메소드 2 / 18 객체지향특징들 객체지향프로그래밍의특징 프로그램은객체와함수정의로구성되며대부분의계산은객체에대한연산으로표현됨객체의정의는

More information

2014 HSC Korean Continuers

2014 HSC Korean Continuers Centre Number 2014 HIGHER SCHOOL CERTIFICATE EXAMINATION Student Number Korean Continuers Total marks 80 Section I Pages 2 4 General Instructions Reading time 10 minutes Working time 2 hours and 50 minutes

More information

10주차.key

10주차.key 10, Process synchronization (concurrently) ( ) => critical section ( ) / =>, A, B / Race condition int counter; Process A { counter++; } Process B { counter ;.. } counter++ register1 = counter register1

More information

chap x: G입력

chap x: G입력 재귀알고리즘 (Recursive Algorithms) 재귀알고리즘의특징 문제자체가재귀적일경우적합 ( 예 : 피보나치수열 ) 이해하기가용이하나, 비효율적일수있음 재귀알고리즘을작성하는방법 재귀호출을종료하는경계조건을설정 각단계마다경계조건에접근하도록알고리즘의재귀호출 재귀알고리즘의두가지예 이진검색 순열 (Permutations) 1 장. 기본개념 (Page 19) 이진검색의재귀알고리즘

More information

Microsoft PowerPoint - chap05-제어문.pptx

Microsoft PowerPoint - chap05-제어문.pptx int num; printf( Please enter an integer: "); scanf("%d", &num); if ( num < 0 ) printf("is negative.\n"); printf("num = %d\n", num); 1 학습목표 제어문인,, 분기문에 대해 알아본다. 인 if와 switch의 사용 방법과 사용시 주의사항에 대해 알아본다.

More information

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

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

More information

<4D F736F F F696E74202D20C1A632C0E520C7C1B7CEB1D7B7A5B0B3B9DFB0FAC1A4>

<4D F736F F F696E74202D20C1A632C0E520C7C1B7CEB1D7B7A5B0B3B9DFB0FAC1A4> 쉽게풀어쓴 C 언어 Express 제 2 장프로그램개발과정 통합개발환경 통합개발환경 (IDE: integrated development environment) 에디터 + 컴파일러 + 디버거 Visual C++: 이클립스 (eclipse): Dev-C++: 마이크로소프트제작 오픈소스프로젝트 오픈소스프로젝트 통합개발환경의종류 비주얼 C++(Visual C++)

More information

vi 사용법

vi 사용법 유닉스프로그래밍및실습 gdb 사용법 fprintf 이용 단순디버깅 확인하고자하는코드부분에 fprintf(stderr, ) 를이용하여그지점까지도달했는지여부와관심있는변수의값을확인 여러유형의단순한문제를확인할수있음 그러나자세히살펴보기위해서는디버깅툴필요 int main(void) { int count; long large_no; double real_no; init_vars();

More information

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - (Asynchronous Mode) - - - ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 - UART (Univ ers al As y nchronous Receiver / T rans mitter) 8250A 8250A { COM1(3F8H). - Line Control Register

More information

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf("hihi\n"); } warning: conflicting types for functiona

4. #include <stdio.h> #include <stdlib.h> int main() { functiona(); } void functiona() { printf(hihi\n); } warning: conflicting types for functiona 이름 : 학번 : A. True or False: 각각항목마다 True 인지 False 인지적으세요. 1. (Python:) randint 함수를사용하려면, random 모듈을 import 해야한다. 2. (Python:) '' (single quote) 는한글자를표현할때, (double quote) 는문자열을표현할때사용한다. B. 다음에러를수정하는방법을적으세요.

More information

02장.배열과 클래스

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

More information

Java

Java Java http://cafedaumnet/pway Chapter 1 1 public static String format4(int targetnum){ String strnum = new String(IntegertoString(targetNum)); StringBuffer resultstr = new StringBuffer(); for(int i = strnumlength();

More information

Something that can be seen, touched or otherwise sensed

Something that can be seen, touched or otherwise sensed Something that can be seen, touched or otherwise sensed Things about an object Weight Height Material Things an object does Pen writes Book stores words Water have Fresh water Rivers Oceans have

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

BMP 파일 처리

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

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

목차 BUG 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG ROLLUP/CUBE 절을포함하는질의는 SUBQUE

목차 BUG 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG ROLLUP/CUBE 절을포함하는질의는 SUBQUE ALTIBASE HDB 6.3.1.10.1 Patch Notes 목차 BUG-45710 문법에맞지않는질의문수행시, 에러메시지에질의문의일부만보여주는문제를수정합니다... 3 BUG-45730 ROUND, TRUNC 함수에서 DATE 포맷 IW 를추가지원합니다... 5 BUG-45760 ROLLUP/CUBE 절을포함하는질의는 SUBQUERY REMOVAL 변환을수행하지않도록수정합니다....

More information

Microsoft PowerPoint - chap-03.pptx

Microsoft PowerPoint - chap-03.pptx 쉽게풀어쓴 C 언어 Express 제 3 장 C 프로그램구성요소 컴퓨터프로그래밍기초 이번장에서학습할내용 * 주석 * 변수, 상수 * 함수 * 문장 * 출력함수 printf() * 입력함수 scanf() * 산술연산 * 대입연산 이번장에서는 C프로그램을이루는구성요소들을살펴봅니다. 컴퓨터프로그래밍기초 2 일반적인프로그램의형태 데이터를받아서 ( 입력단계 ), 데이터를처리한후에

More information