Skip to content

Commit e4eaf34

Browse files
author
coppermilk
authored
Create ch11ex01.c
1 parent d17aaf8 commit e4eaf34

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ch11/ch11ex01.c

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#include <stdio.h>
2+
3+
#define SIZE 5
4+
void fill_array(char ar[SIZE], int size);
5+
6+
int main() {
7+
char ar[SIZE];
8+
fill_array(ar, SIZE);
9+
for (int i = 0; i < SIZE; i++) {
10+
putchar(ar[i]);
11+
}
12+
return 0;
13+
}
14+
15+
void fill_array(char ar[SIZE], int size) {
16+
for (int i = 0; i < size; i++) {
17+
ar[i] = getchar();
18+
}
19+
20+
}

0 commit comments

Comments
 (0)