ๆญฏ7์žฅ.PDF

Similar documents
chap7.PDF

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 \

chap8.PDF

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


: 1 int arr[9]; int n, i; printf(" : "); scanf("%d", &n); : : for(i=1; i<10; i++) arr[i-1] = n * i; for(i=0; i<9; i++) if(i%2 == 1) print

untitled

PowerPoint ํ”„๋ ˆ์  ํ…Œ์ด์…˜

C++-ยฟรยบยฎร‡ร˜ยผยณ10ร€รฅ

ๆญฏ9์žฅ.PDF

untitled

13 ์ฃผ์ฐจ๋ฌธ์ž์—ด์˜ํ‘œํ˜„๊ณผ์ž…์ถœ๋ ฅ

chap7.key

Microsoft PowerPoint - 06_(C_Programming)_(Korean)_Characters_Strings

Microsoft PowerPoint - 10์žฅ ๋ฌธ์ž์—ด pptx

๋ฌธ์„œ์˜ ์ œ๋ชฉ ๋‚˜๋ˆ”๋ช…์กฐR, 40pt

untitled

11์žฅ ํฌ์ธํ„ฐ

Microsoft PowerPoint - chap10-ํ•จ์ˆ˜์˜ํ™œ์šฉ.pptx

Microsoft PowerPoint - ์ œ9๊ฐ• ๋ฌธ์ž์—ด


Microsoft PowerPoint - chap13-์ž…์ถœ๋ ฅ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ.pptx

์Šฌ๋ผ์ด๋“œ 1

์‹ฌํ™”ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์„ค๊ณ„

Microsoft PowerPoint - Chapter_08.pptx

11์žฅ ํฌ์ธํ„ฐ

untitled

3. 1 ํฌ์ธํ„ฐ๋ž€ 3. 2 ํฌ์ธํ„ฐ๋ณ€์ˆ˜์˜์„ ์–ธ๊ณผ์‚ฌ์šฉ 3. 3 ๋‹ค์ฐจ์›ํฌ์ธํ„ฐ๋ณ€์ˆ˜์˜์„ ์–ธ๊ณผ์‚ฌ์šฉ 3. 4 ์ฃผ์†Œ์˜๊ฐ€๊ฐ์‚ฐ 3. 5 ํ•จ์ˆ˜ํฌ์ธํ„ฐ

๋ชฉ์ฐจ ํฌ์ธํ„ฐ์˜๊ฐœ์š” ๋ฐฐ์—ด๊ณผํฌ์ธํ„ฐ ํฌ์ธํ„ฐ์˜๊ตฌ์กฐ ์‹ค๋ฌด์‘์šฉ์˜ˆ์ œ C 2

์ด๋ฒˆ์žฅ์—์„œํ•™์Šตํ• ๋‚ด์šฉ ๋ฌธ์žํ‘œํ˜„๋ฐฉ๋ฒ• ๋ฌธ์ž์—ดํ‘œํ˜„๋ฐฉ๋ฒ• ๋ฌธ์ž์—ด์ด๋ž€๋ฌด์—‡์ธ๊ฐ€? ๋ฌธ์ž์—ด์˜์ž…์ถœ๋ ฅ ๋ฌธ์ž์ฒ˜๋ฆฌ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌํ•จ์ˆ˜ ํ‘œ์ค€์ž…์ถœ๋ ฅ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌํ•จ์ˆ˜ ์ธ๊ฐ„์€๋ฌธ์ž๋ฅผ์‚ฌ์šฉํ•˜์—ฌ์ •๋ณด๋ฅผํ‘œํ˜„ํ•˜๋ฏ€๋กœ๋ฌธ์ž์—ด์€ํ”„๋กœ๊ทธ๋žจ์—์„œ์ค‘์š”ํ•œ์œ„์น˜๋ฅผ์ฐจ์ง€ํ•˜๊ณ ์žˆ๋‹ค. ์ด๋ฒˆ์žฅ์—์„œ๋Š” C ์—์„œ์˜๋ฌธ์ž์—ด์ฒ˜๋ฆฌ๋ฐฉ๋ฒ•์—๋Œ€ํ•˜์—ฌ์ž์„ธํžˆ์‚ดํŽด๋ณผ๊ฒƒ์ž…๋‹ˆ๋‹ค. 2

<4D F736F F F696E74202D D20B9AEC0DABFAD2C20BDBAC6AEB8B2B0FA20C6C4C0CF20C0D4C3E2B7C2>

Microsoft PowerPoint - chap-12.pptx

Microsoft PowerPoint - Chapter_07.pptx

, ( ),, ( ), 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

<4D F736F F F696E74202D D20B9AEC0DABFAD2C20BDBAC6AEB8B2B0FA20C6C4C0CF20C0D4C3E2B7C2>

02์žฅ.๋ฐฐ์—ด๊ณผ ํด๋ž˜์Šค

PowerPoint ํ”„๋ ˆ์  ํ…Œ์ด์…˜

< E20C6DFBFFEBEEE20C0DBBCBAC0BB20C0A7C7D12043BEF0BEEE20492E707074>


์ด๋ฒˆ์žฅ์—์„œํ•™์Šตํ• ๋‚ด์šฉ ๋™์ ๋ฉ”๋ชจ๋ฆฌ๋ž€? malloc() ์™€ calloc() ์—ฐ๊ฒฐ๋ฆฌ์ŠคํŠธ ํŒŒ์ผ์„์ด์šฉํ•˜๋ฉด๋ณด๋‹ค๋งŽ์€๋ฐ์ดํ„ฐ๋ฅผ์œ ์šฉํ•˜๊ณ ์ง€์†์ ์œผ๋กœ์‚ฌ์šฉ๋ฐ๊ด€๋ฆฌํ• ์ˆ˜์žˆ์Šต๋‹ˆ๋‹ค. 2

PA for SWE2007

Microsoft PowerPoint - ch07 - ํฌ์ธํ„ฐ pm0415

๋น„ํŠธ์™€๋ฐ”์ดํŠธ ๋น„ํŠธ์™€๋ฐ”์ดํŠธ ๋น„ํŠธ (Bit) : 2์ง„์ˆ˜๊ฐ’ํ•˜๋‚˜ (0 ๋˜๋Š” 1) ๋ฅผ์ €์žฅํ• ์ˆ˜์žˆ๋Š”์ตœ์†Œ๋ฉ”๋ชจ๋ฆฌ๊ณต๊ฐ„ 1๋น„ํŠธ 2๋น„ํŠธ 3๋น„ํŠธ... n๋น„ํŠธ 2^1 = 2๊ฐœ 2^2 = 4๊ฐœ 2^3 = 8๊ฐœ... 2^n ๊ฐœ 1 ๋ฐ”์ดํŠธ๋Š” 8 ๋น„ํŠธ 2 2

Microsoft PowerPoint - ch07 - ํฌ์ธํ„ฐ pm0415

Chapter_06

PA for SWE2007

Microsoft PowerPoint - Chapter_09.pptx

ABC 6์žฅ


PowerPoint ํ”„๋ ˆ์  ํ…Œ์ด์…˜

Microsoft PowerPoint - [2009] 02.pptx

13์ฃผ-14์ฃผproc.PDF

Microsoft PowerPoint - chap06.ppt

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

์ œ 14 ์žฅํฌ์ธํ„ฐํ™œ์šฉ ์œ ์ค€๋ฒ” (JUNBEOM YOO) Ver ๋ณธ๊ฐ•์˜์ž๋ฃŒ๋Š”์ƒ๋Šฅ์ถœํŒ์‚ฌ์˜ PPT ๊ฐ•์˜์ž๋ฃŒ ๋ฅผ๊ธฐ๋ฐ˜์œผ๋กœ์ œ์ž‘๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

Microsoft PowerPoint - 7_๋ฐฐ์—ด_๋ฌธ์ž์—ด

YRRZBRRLMCEQ.hwp

Infinity(โˆž) Strategy

chap10.PDF

Microsoft PowerPoint - Chapter14_17.pptx

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7>

Microsoft PowerPoint - Lesson14.pptx

Microsoft PowerPoint - Lesson14.pptx

Microsoft PowerPoint - chap06-4 [ํ˜ธํ™˜ ๋ชจ๋“œ]

Microsoft PowerPoint - chap02-Cํ”„๋กœ๊ทธ๋žจ์‹œ์ž‘ํ•˜๊ธฐ.pptx

C ์–ธ์–ด ํ”„๋กœ๊ทธ๋ž˜๋ฐŠ ๊ณผ์ œ ํ’€์ด

11์žฅ ํฌ์ธํ„ฐ

Line (A) รฅ j a k= i k #define max(a, b) (((a) >= (b))? (a) : (b)) long MaxSubseqSum0(int A[], unsigned Left, unsigned Right) { int Center, i; long Max

์ค‘๊ฐ„๊ณ ์‚ฌ

11์žฅ ํฌ์ธํ„ฐ

<4D F736F F F696E74202D20C1A63134C0E520C6F7C0CEC5CD5FC8B0BFEB>

C++ Programming

Microsoft PowerPoint - Cํ”„๋กœ๊ทธ๋ž˜๋ฐ-chap15.ppt [ํ˜ธํ™˜ ๋ชจ๋“œ]

C ํ”„๋กœ๊ทธ๋ž˜๋ฐŠ ๊ฐœ์š”

Microsoft PowerPoint - Chapter_05.pptx

03แ„Œแ…กแ†ผ.แ„‰แ…ณแ„แ…ขแ†จ.key

์ œ1์žฅ Unix๋ž€ ๋ฌด์—‡์ธ๊ฐ€?

๊ธˆ์˜ค๊ณต๋Œ€ ์ปดํ“จํ„ฐ๊ณตํ•™์ „๊ณต ๊ฐ•์˜์ž๋ฃŒ

PowerPoint Presentation

ABC 6์žฅ

PA0 for SSE2033

ch15

๋ณธ ๊ฐ•์˜์— ๋“ค์–ด๊ฐ€๊ธฐ ์ „

ํ”„๋กœ๊ทธ๋žจ์„ ํ•™๊ต ๋“ฑ์ง€์—์„œ ์กฐ๊ธˆ์ด๋ผ๋„ ๋ฐฐ์šด ์‚ฌ๋žŒ๋“ค์„ ์œ„ํ•œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ๋…ธํŠธ ์ž…๋‹ˆ๋‹ค. ์ € ์—ญ์‹œ ๊ทธ ์‚ฌ๋žŒ๋“ค ์ค‘ ํ•˜๋‚˜ ์ž…๋‹ˆ๋‹ค. ์ค‘๊ณ ๋“ฑํ•™๊ต ์‹œ์ ˆ ํ•™๊ต ๋„์„œ๊ด€, ์ƒˆ๋กœ ์ƒ๊ธด ์‹œ๋ฆฝ ๋„์„œ๊ด€ ๋“ฑ์„ ๋‹ค๋‹ˆ๋ฉฐ ์ฑ…์„ ๋ณด ๊ณ  ์ •๋ฆฌํ•˜๋ฉฐ ์–ด๋Š์ •๋„ ๋…ํ•™์œผ๋ฅด ๊ณต๋ถ€ํ•˜๊ธด ํ–ˆ์ง€๋งŒ, ์ž์ฃผ ์•ˆํ•˜๋‹ค ๋ณด๋ฉด ๊ธˆ๋ฐฉ ์žŠ์–ด

Microsoft PowerPoint - chap03-๋ณ€์ˆ˜์™€๋ฐ์ดํ„ฐํ˜•.pptx

ๅ•†็”จ

ร€ยฉยตยตยณร—ร†ยฎยฟรทร‡รยทรŽยฑร—ยทยกยนร–4ร€รฅ_รƒร–รยพ

MPLAB C18 C

02 C h a p t e r Java

Microsoft PowerPoint - [CPI16] Lecture 10 - ๋ฌธ์ž์—ด.pptx

Microsoft PowerPoint - chap06-8 [ํ˜ธํ™˜ ๋ชจ๋“œ]

PowerPoint ํ”„๋ ˆ์  ํ…Œ์ด์…˜

PowerPoint ํ”„๋ ˆ์  ํ…Œ์ด์…˜

BMP ํŒŒ์ผ ์ฒ˜๋ฆฌ

<4D F736F F F696E74202D20C1A63132C0E520B9AEC0DABFCD20B9AEC0DABFAD>

Microsoft PowerPoint - chap11-ํฌ์ธํ„ฐ์˜ํ™œ์šฉ.pptx

[ ๋งˆ์ดํฌ๋กœํ”„๋กœ์„ธ์„œ 1] 2 ์ฃผ์ฐจ 3 ์ฐจ์‹œ. ํฌ์ธํ„ฐ์™€๊ตฌ์กฐ์ฒด 2 ์ฃผ์ฐจ 3 ์ฐจ์‹œํฌ์ธํ„ฐ์™€๊ตฌ์กฐ์ฒด ํ•™์Šต๋ชฉํ‘œ 1. C ์–ธ์–ด์—์„œ๊ฐ€์žฅ์–ด๋ ค์šดํฌ์ธํ„ฐ์™€๊ตฌ์กฐ์ฒด๋ฅผ์„ค๋ช…ํ• ์ˆ˜์žˆ๋‹ค. 2. Call By Value ์™€ Call By Reference ๋ฅผ๊ตฌ๋ถ„ํ• ์ˆ˜์žˆ๋‹ค. ํ•™์Šต๋‚ด์šฉ 1 : ํ•จ์ˆ˜ (Functi

Microsoft PowerPoint - chap06-8.ppt

Microsoft PowerPoint - Chapter_04.pptx

PowerPoint ํ”„๋ ˆ์  ํ…Œ์ด์…˜

Transcription:

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}}; int array[3][10]={"turbo-c","is","easy!"}; 6

[ 7-1] #include <stdio.h> #define MAX 10 int prn(int x[max]); main(){ int num[max] = {1,2,3,4,5,6,7,8,9,10}; prn(&num[0]); } int prn(int x[max]){ int i; printf("the address of array name is %d \n", x); for ( i = 0 ; i < MAX ; i++ ){ printf("address : %d\t", &x[i]); printf("value : %d\n", x[i]); } } /* prn */ 7

[ 7-1] [ ] The address of array name is 404 ADDRESS : 4076 VALUE : 1 ADDRESS : 4078 VALUE : 2 ADDRESS : 4080 VALUE : 3 : : : : ADDRESS : 4094 VALUE : 10 8

. pnt a, pnt a. * ; 9

[ 7-2] #include<stdio.h> main() { int a = 50; int *pnt; } printf("a=%d pnt=%d\n ",a,pnt); [ ] a=50 pnt=1824 10

[ 7-3] #include<stdio.h> main() { int a = 50; int *pnt; /* */ /* */ } pnt = &a; /* */ printf("a=%d pnt=%d \n",a,pnt); [ ] a=50 pnt=4094 11

: int_pnt2=int_pnt1+1; int_pnt1 (int==> 2byte) int_pnt2 100 103 int_pnt1 int_pnt2 ` ' int_pnt++ ==> 2byte float_pnt++ ==> 4byte 12

[ 7-4] #include <stdio.h> #define MAX 10 int i_array[max] = {1, 2, 3, 4, 5, 6, 7, 8, 9,10}; /* */ int I; int *i_pnt; /* */ float f_array[max] = {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}; /* */ float *f_pnt; /* */ main(){ i_pnt = i_array; /* */ f_pnt = f_array; /* */ [ ] for ( i=0 ; i<max ; i++) 1 0.100000 printf("%d\t%f\n",*i_pnt++,*f_pnt++); 2 0.200000 } 3 0.300000 : : 10 1.000000 13

(*) ([]) *(pnt+i) : pnt i. array[i] : array I. : char *pnt[3]={`kim',`lee',`park'}; pnt malloc(), calloc() 14

[ 7-5] #include<stdio.h> main(){ int a[5]={1,2,3,4}; int *pnt; } pnt = a; printf("%d %d %d %d \n",*pnt,*(pnt+1),*(pnt+2),*(pnt+3)); printf("%d %d %d %d \n",a[0],a[1],a[2],a[3]) ; [ ] 1 2 3 4 1 2 3 4 /* */ 15

[ 7-6] #include<stdio.h> main(){ int a[2][2] = { 1,2, 3,4 }; int *pnt; pnt=a[0]; printf("%d %d\n%d %d\n",*pnt,*(pnt+1),*(pnt+1*2),*(pnt+1*2+1)); printf("%d %d\n%d %d\n",a[0][0],a[0][1],a[1][0],a[1][1]); } [ ] 1 2 3 4 1 2 /* */ 3 4 16

[ 7-7] #include<stdio.h> main() { int a[4] = {1, 2, 3, 4}; int *pnt; } pnt=a; printf("%d %d %d %d \n",pnt[0],pnt[1],pnt[2],pnt[3]); [ ] 1 2 3 4 17

main int main() int main( argc, argv ) int argc; char **argv; char **string_array={"dog","cat","lion","tiger"}; void 18

[ 7-8] #include<stdio.h> void main() { char *pnt[] = {"Chan","Ho","Park"}; char array[3][5]= {"Chan","Ho","Park"}; int j; printf("memory address of pointer array pnt\n"); printf("pnt => %p\n",pnt); for(j=0;j<3;j++) printf("pnt[%d] (address %p) => %s\n",j,pnt[j],pnt[j]); /* */ /* */ printf("\nmemory address of two-dimensional array\n"); printf("array => %p\n",array); for(j=0;j<3;j++) printf("array[%d] (address %p) => %s\n",j,array[j], array[j]); } 19

[ 7-8] [ ] memory address of pointer array pnt pnt => 1747:0FF4 pnt[0] (address 16FB:00AF) => Chan pnt[1] (address 16FB:00B4) => Ho pnt[2] (address 16FB:00B7) => Park memory address of two-dimensional arrayarray => 1747:0FE4 array[0] (address 1747:0FE4) => Chan array[1] (address 1747:0FE9) => Ho array[2] (address 1747:0FEE) => Park 20

[ 7-9] #include<stdio.h> main() { int x; int *pnt=&x; int **p_pnt=&pnt; /* pnt x */ /* p_pnt pnt */ } **p_pnt=100; printf("x=%d\n",x); /* x 100 */ [ ] x=100 21

ASCII char char char array[6]="seoul"; 22

[ 7-10] /* */ #include <stdio.h> main() { char ch = 'a'; char num = '2'; } printf("ch=%c, num=%c\n",ch,num); [ ] ch=a, num=2 23

char *pnt="hello"; pnt `h'. char pnt[]="hello"; ==> `h. 24

gets(), scanf() stdio.h gets() gets(*str); str scanf() scanf("%s",*str); str 25

[ 7-11] #include <stdio.h> main() { char array[20]; } printf("enter a string : "); gets(array); printf("the received string : %s\n", array); [ ] Enter a string : I love you. The received string : I love you. 26

[ 7-12] #include <stdio.h> main() { char season[10]; char month[10]; printf("enter season and month\n"); scanf("%s%s", season, month); printf("season = %s, month = %s", season, month); } [ ] Enter season and month spring May season = spring, month = May 27

puts(), prinf() stdio.h puts() puts(*str); printf() str printf("%s",str); str 28

[ 7-13] /* Example using puts() library function */ #include <stdio.h> main(){ char *a="how"; char *b="old"; char string1[]="are"; char string2[]="you!"; puts(a); puts(b); puts(string1); puts(string2); [ ] } How old are you! 29

[ 7-14] /* Example using printf() library function */ #include <stdio.h> main(){ char f_name[30] = "Michael"; char l_name[30] = "Jordan"; } printf("what`s your name?\n"); printf("f_name : %s\n", f_name); printf("l_name : %s\n", l_name); [ ] What`s your name? f_name : Michael l_name : Jordan 30

string.h, strlen() size_t strlen(char *str);, strcpy() str char *strcpy(char *destination, char *source);, strcat() source destination strcat(char *destination, char *source); source destination 31

[ 7-15] /* Program for an example of string library functions */ #include <stdio.h> #include <string.h> main(){ char string[30]; int a; printf("enter a string : "); gets(string); a=strlen(string); printf("the length of string is %d.",a); } [ ] Enter a string : abcdefg The length of string is 7. 32

[ 7-16] /* Example using strcpy() function */ #include <stdio.h> #include <string.h> main(){ char str1[80],str2[80],*str3; printf("enter string1 : "); gets(str1); printf("enter string2 : "); gets(str2); str3=strcpy(str1,str2); printf("%s is copied in str1\n",str3); } [ ] Enter string1 : Korea Enter string2 : aerok aerok is copied in str1 33

[ 7-17] /* Example using strcat() library function */ #include <stdio.h> #include <string.h> main(){ char dest[80]; char sour[80]; } gets(dest); printf("this string, [%s] is in dest.\n", dest); gets(sour); strcat(dest, sour); printf("this string, [%s] is in sour.\n", sour); printf("this string, [%s] is in dest.", dest); 34

[ 7-17] [ ] Hi, This string, [Hi, ] is in dest. everyone. This string, [everyone.] is in sour. This string, [Hi, everyone.] is in dest. 35

, strchr() strchr(char *a, int b); a b, strlwr() strupr() strlwr(char *ptr); ptr 36

[ 7-18] /* Example using srtchr() library function */ #include <stdio.h> #include <string.h> void main(void){ char a[80],*d; int c; printf("enter a string : "); gets(a); printf("the character to be searched : "); c=getchar(); d=strchr(a,c); printf("the character you are searching,"); printf("'%c'is discovered %d position in a.",c,d-a+1); } 37

[ 7-18] [ ] Enter a string : beautiful The character to be searched : l The character you are searching,'l'is discovered 9 position in a. 38

[ 7-19] /* Example using strlwr() and strupr() */ #include <stdio.h> #include <ctype.h> main(){ char a,b,c; char ch; printf("enter alphabet : "); scanf("%c", &ch); b = tolower( ch ); printf("convert into lower case letter : %c\n",b); c = toupper( ch ); printf("convert into upper case letter : %c\n",c); } [ ] Enter alphabet : a Convert into lower case letter : a Convert into upper case letter : A 39