Skip to content

0017 C ๐ŸŽ

README#

๋ณธ ํŒŒ์ผ์€ week 04 {swjungle} {Red Black Tree} ํ•™์Šต์— ์„ ํ–‰๋  C ์–ธ์–ด ํ•™์Šต์„ ์œ„ํ•ด ์ œ์ž‘๋˜์—ˆ์Šต๋‹ˆ๋‹ค. C๋ฅผ ์ฑ…์„ ๋ด๊ฐ€๋ฉด์„œ ์ •๋…ํ•˜๊ธฐ ๋ณด๋‹ค๋Š” ๋ฌธ์ œ๋ฅผ ๋จผ์ € ํ’€๋ฉด์„œ ๋นต๊พธ๋ฅผ ๋ฉ”์šฐ๋Š” ๋ฐฉํ–ฅ์œผ๋กœ ์ง„ํ–‰ํ•  ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.

DUMP#

  • charํ˜•์ด 1๋ฐ”์ดํŠธ์ธ๋ฐ๋„ 7๊ฐœ์˜ ๋น„ํŠธ(0..=255)๋ฐ–์— ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ์ด์œ ๋Š” ์˜ค๋ฅ˜์ฒดํฌ๋ฅผ ์œ„ํ•ด์„œ์ด๋‹ค.
  • ํฌ์ธํ„ฐ ์ƒ์ˆ˜, ๋ฐฐ์—ด์€ ์ง์ ‘ ๊ทธ ๊ฐ’์„ ๋ฐ”๊ฟ€ ์ˆ˜ ์—†๋‹ค.
  • intํ˜• ๋ณ€์ˆ˜๋ฅผ char *๋กœ ์บ์ŠคํŒ… ํ•˜์—ฌ 4๊ฐœ ํฌ๊ธฐ์˜ ๋ฐฐ์—ด์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ๋‹ค.
    • char * c_p = (char*)&int_var;
    • c_p[0], c_p[1], c_p[2], c_p[3]
    • [?] ๊ทธ๋ ‡๋‹ค๋ฉด, intํ˜• ๋ฐฐ์—ด์„ charํ˜• ์ด์ฐจ์› ๋ฐฐ์—ด๋กœ ๋งŒ๋“ค ์ˆ˜๋„ ์žˆ๊ฒ ๋„ค?
  • char *str = "Hello, world"์—์„œ "Hello, world"๋Š” .data ์˜์—ญ, ๋ฉ”๋ชจ๋ฆฌ ๋กœ๋“œ์‹œ .rodata์— ์ €์žฅ๋œ๋‹ค. ์ฐธ๊ณ ๋กœ ReadOnlyData ์˜์—ญ์ด๋ผ์„œ .rodata์ด๋‹ค.
  • Functions can return any type EXCEPT array and functions
  • [v] realloc์„ ์ˆ˜ํ–‰ํ•˜๋ฉด ๊ธฐ์กด์˜ ์ฃผ์†Œ๊ฐ’์„ ๋ฒ„๋ฆฌ๊ณ  ์ƒˆ ์ฃผ์†Œ๋กœ ์ด์ฃผ๋ฅผ ํ•˜๋Š” ๊ฒƒ์ธ๊ฐ€, ๋ณต์‚ฌ๋ฅผ ํ•˜๋Š” ๊ฒƒ์ธ๊ฐ€? realloc {C}
  • [ ] memcpy {C}
  • [ ] strcpy and strcat {C}
  • [ ] google cppguide

INDEX#

Basics of C#

ADVANCED#

My Own Libraries#

data structures