1# C ํ๋ก๊ทธ๋๋ฐ ์์ ์ฝ๋
2
3์ด ํด๋์๋ C ํ๋ก๊ทธ๋๋ฐ ํ์ต ๋ฌธ์์ ๋ชจ๋ ์์ ์ฝ๋๊ฐ ํฌํจ๋์ด ์์ต๋๋ค.
4
5## ๋๋ ํ ๋ฆฌ ๊ตฌ์กฐ
6
7```
8examples/
9โโโ 02_calculator/ # ๊ณ์ฐ๊ธฐ
10โโโ 03_number_guess/ # ์ซ์ ๋ง์ถ๊ธฐ ๊ฒ์
11โโโ 04_address_book/ # ์ฃผ์๋ก
12โโโ 05_dynamic_array/ # ๋์ ๋ฐฐ์ด
13โโโ 06_linked_list/ # ์ฐ๊ฒฐ ๋ฆฌ์คํธ
14โโโ 07_file_crypto/ # ํ์ผ ์ํธํ
15โโโ 08_stack_queue/ # ์คํ๊ณผ ํ
16โโโ 09_hash_table/ # ํด์ ํ
์ด๋ธ
17โโโ 10_snake_game/ # ๋ฑ ๊ฒ์
18โโโ 11_minishell/ # ๋ฏธ๋ ์
19โโโ 12_multithread/ # ๋ฉํฐ์ค๋ ๋
20โโโ 13_embedded_basic/ # ์๋ฒ ๋๋ ๊ธฐ์ด (Arduino)
21โโโ 14_bit_operations/ # ๋นํธ ์ฐ์ฐ
22โโโ 15_gpio_control/ # GPIO ์ ์ด (Arduino)
23โโโ 16_serial_comm/ # ์๋ฆฌ์ผ ํต์ (Arduino)
24```
25
26## ์ปดํ์ผ ๋ฐฉ๋ฒ
27
28### C ํ๋ก๊ทธ๋จ (๋ฐ์คํฌํฑ)
29
30```bash
31# ๊ธฐ๋ณธ ์ปดํ์ผ
32gcc program.c -o program
33
34# ๊ฒฝ๊ณ ํฌํจ
35gcc -Wall -Wextra program.c -o program
36
37# ๋๋ฒ๊ทธ ์ ๋ณด ํฌํจ
38gcc -g program.c -o program
39
40# ์ต์ ํ
41gcc -O2 program.c -o program
42```
43
44### ๋ฉํฐ์ค๋ ๋ ํ๋ก๊ทธ๋จ
45
46```bash
47# Linux
48gcc program.c -o program -pthread
49
50# macOS
51gcc program.c -o program -lpthread
52```
53
54### Arduino ํ๋ก๊ทธ๋จ
55
56Arduino ํ๋ก๊ทธ๋จ(.ino)์ ๋ค์ ๋ฐฉ๋ฒ์ผ๋ก ์คํ:
57
581. **Arduino IDE**
59 - ํ์ผ ์ด๊ธฐ
60 - ๋ณด๋ ์ ํ (Tools โ Board โ Arduino Uno)
61 - ์
๋ก๋ ๋ฒํผ ํด๋ฆญ
62
632. **Wokwi ์๋ฎฌ๋ ์ดํฐ** (๊ถ์ฅ)
64 - https://wokwi.com ์ ์
65 - New Project โ Arduino Uno
66 - ์ฝ๋ ๋ณต์ฌ/๋ถ์ฌ๋ฃ๊ธฐ
67 - Start Simulation
68
693. **PlatformIO (VS Code)**
70 ```bash
71 pio run
72 pio run --target upload
73 ```
74
75## ๊ฐ ํ๋ก์ ํธ ์ค๋ช
76
77| ํ๋ก์ ํธ | ๋์ด๋ | ์ฃผ์ ๊ฐ๋
|
78|----------|--------|-----------|
79| 02. ๊ณ์ฐ๊ธฐ | โญ | ํจ์, switch-case, scanf |
80| 03. ์ซ์ ๋ง์ถ๊ธฐ | โญ | ๋ฐ๋ณต๋ฌธ, ๋๋ค, ์กฐ๊ฑด๋ฌธ |
81| 04. ์ฃผ์๋ก | โญโญ | ๊ตฌ์กฐ์ฒด, ๋ฐฐ์ด, ํ์ผ I/O |
82| 05. ๋์ ๋ฐฐ์ด | โญโญ | malloc, realloc, free |
83| 06. ์ฐ๊ฒฐ ๋ฆฌ์คํธ | โญโญโญ | ํฌ์ธํฐ, ๋์ ์๋ฃ๊ตฌ์กฐ |
84| 07. ํ์ผ ์ํธํ | โญโญ | ํ์ผ ์ฒ๋ฆฌ, ๋นํธ ์ฐ์ฐ |
85| 08. ์คํ/ํ | โญโญ | ์๋ฃ๊ตฌ์กฐ, LIFO/FIFO |
86| 09. ํด์ ํ
์ด๋ธ | โญโญโญ | ํด์ฑ, ์ถฉ๋ ์ฒ๋ฆฌ |
87| 10. ๋ฑ ๊ฒ์ | โญโญโญ | ํฐ๋ฏธ๋ ์ ์ด, ๊ฒ์ ๋ฃจํ |
88| 11. ๋ฏธ๋ ์ | โญโญโญโญ | fork, exec, ํ์ดํ |
89| 12. ๋ฉํฐ์ค๋ ๋ | โญโญโญโญ | pthread, ๋๊ธฐํ |
90| 13. ์๋ฒ ๋๋ ๊ธฐ์ด | โญ | Arduino, GPIO |
91| 14. ๋นํธ ์ฐ์ฐ | โญโญ | ๋นํธ ๋ง์คํน, ๋ ์ง์คํฐ |
92| 15. GPIO ์ ์ด | โญโญ | LED, ๋ฒํผ, ๋๋ฐ์ด์ฑ |
93| 16. ์๋ฆฌ์ผ ํต์ | โญโญ | UART, ๋ช
๋ น์ด ํ์ฑ |
94
95## ํ์ต ์์
96
97### ์ด๊ธ
981. ๊ณ์ฐ๊ธฐ
992. ์ซ์ ๋ง์ถ๊ธฐ
1003. ์ฃผ์๋ก
101
102### ์ค๊ธ
1034. ๋์ ๋ฐฐ์ด
1045. ์ฐ๊ฒฐ ๋ฆฌ์คํธ
1056. ํ์ผ ์ํธํ
1067. ์คํ๊ณผ ํ
1078. ํด์ ํ
์ด๋ธ
108
109### ๊ณ ๊ธ
1109. ๋ฑ ๊ฒ์
11110. ๋ฏธ๋ ์
11211. ๋ฉํฐ์ค๋ ๋
113
114### ์๋ฒ ๋๋ (Arduino)
11512. ์๋ฒ ๋๋ ๊ธฐ์ด
11613. ๋นํธ ์ฐ์ฐ
11714. GPIO ์ ์ด
11815. ์๋ฆฌ์ผ ํต์
119
120## ์คํ ์์
121
122### ๊ณ์ฐ๊ธฐ
123```bash
124cd 02_calculator
125gcc calculator.c -o calculator
126./calculator
127```
128
129### ๋ฉํฐ์ค๋ ๋
130```bash
131cd 12_multithread
132gcc thread_basic.c -o thread_basic -pthread
133./thread_basic
134```
135
136### Arduino (Wokwi)
1371. ์ฝ๋ ๋ณต์ฌ
1382. https://wokwi.com ์์ ์ ํ๋ก์ ํธ
1393. ๋ถ์ฌ๋ฃ๊ธฐ ํ ์คํ
140
141## ๋ฌธ์ ํด๊ฒฐ
142
143### ์ปดํ์ผ ์ค๋ฅ
144- `undefined reference to 'pthread_create'`: `-pthread` ํ๋๊ทธ ์ถ๊ฐ
145- `implicit declaration of function`: ํค๋ ํ์ผ ์ถ๊ฐ
146- `permission denied`: `chmod +x program`
147
148### ์คํ ์ค๋ฅ
149- Segmentation fault: ํฌ์ธํฐ ํ์ธ, valgrind ์ฌ์ฉ
150- Bus error: ์๋ชป๋ ๋ฉ๋ชจ๋ฆฌ ์ ๊ทผ
151- Memory leak: valgrind๋ก ํ์ธ
152
153## ์ถ๊ฐ ์๋ฃ
154
155- [C Reference](https://en.cppreference.com/w/c)
156- [Arduino Reference](https://www.arduino.cc/reference/en/)
157- [Wokwi Simulator](https://wokwi.com)