๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๋ฐ˜์‘ํ˜•

์ฒœ์ฒœํžˆ, ๊พธ์ค€ํžˆ..15

[C : ls] C์–ธ์–ด๋กœ ls ๊ตฌํ˜„ํ•˜๊ธฐ #dirent ls๋ฅผ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉ ํ•  dirent์— ๋Œ€ํ•ด ์•Œ์•„๋ด„ directory ๋ฅผ ์—ด๊ธฐ ์œ„ํ•ด opendir() ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๋ฐ, ์–˜๋Š” ๋””๋ ‰ํ„ฐ๋ฆฌ๊ฒฝ๋กœ๋ฅผ ๋ฐ›๊ณ , ๋””๋ ‰ํ„ฐ๋ฆฌ๋ฅผ ์—ด ์ˆ˜ ์žˆ์œผ๋ฉด DIR *, ์—ด ์ˆ˜ ์—†์œผ๋ฉด NULL ๋ฐ˜ํ™˜ /* Open a directory stream on NAME. Return a DIR stream on the directory, or NULL if it could not be opened. This function is a possible cancellation point and therefore not marked with __THROW. */ extern DIR *opendir (const char *__name) __nonnull ((1)); DIR์€ ๋ญ์ง€ ? /* This i.. 2023. 12. 16.
[C : ctags] ctags ์„ค์น˜ #universal-ctags ctags ์•„๋‹ˆ๊ณ  universal-ctags ์˜ค๋žœ๋งŒ์— C์–ธ์–ด๋ฅผ ๋‹ค์‹œ๋ณด๋ฉด์„œ.. ctags๋ฅผ ์“ฐ๋ ค๊ณ  ํ–ˆ๋”๋‹ˆ ์„ค์น˜๊ฐ€ ์•ˆ๋˜์–ด ์žˆ์–ด์„œ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ–ˆ๋Š”๋ฐ.. ๐Ÿ˜ฅ ์™œ๋•Œ๋ฌธ์— ํŒจํ‚ค์ง€๊ฐ€ ์—…์จ !!! ๐Ÿ˜ก E: Package 'ctags' has no installation candidate mimi@mimi:~/Mimi/lang/c$ sudo apt-get install -y ctags Reading package lists... Done Building dependency tree... Done Reading state information... Done Package ctags is a virtual package provided by: exuberant-ctags 1:5.9~svn20110310-16ubuntu0.2.. 2023. 12. 16.
[C : echo] ํ„ฐ๋ฏธ๋„๋กœ ์ž…๋ ฅ๋ฐ›์€ ๊ฐ’ ์ถœ๋ ฅํ•˜๊ธฐ #argc #argv echo๋ฅผ c์–ธ์–ด๋กœ ๊ตฌํ˜„ํ•ด๋ณด๊ณ ์ž ํ•จ ! mimi@mimi:~/Mimi/lang/c$ echo aaa bbb ccc aaa bbb ccc ๋ช…๋ น๊ณผ ํ•จ๊ป˜ ์ž…๋ ฅ๋ฐ›์€ ์ธ์ž๋“ค์„ ๊ทธ๋Œ€๋กœ ์ถœ๋ ฅํ•ด์ฃผ๊ธฐ ! ์ž…๋ ฅ๋ฐ›์€ ์ธ์ž์˜ ๊ธธ์ด๋Š” ์–ด๋–ป๊ฒŒ ์•Œ์ง€ ? int argc ์ž…๋ ฅ๋ฐ›์€ ์ธ์ž์˜ ๋‚ด์šฉ์€ ์–ด๋–ป๊ฒŒ ์•Œ์ง€ ? char* argv[] (๋˜๋Š” char** argv) ๊ทธ๋Ÿผ ์ด๊ฑธ ์–ด๋–ป๊ฒŒ ์“ฐ์ง€ ? main ํ•จ์ˆ˜์—์„œ int argc์™€ char* argv[] ๋ฅผ ์ธ์ž๋กœ ๋ฐ›๋„๋ก ์ž‘์„ฑํ•˜๊ธฐ ! #include int main(int argc, char* argv[]) { // ์ฝ”๋“œ์ž‘์„ฑ return 0; } argc๋Š” ๊ณต๋ฐฑ์„ ๊ธฐ์ค€์œผ๋กœ ํ„ฐ๋ฏธ๋„์—์„œ ๋ช…๋ น์œผ๋กœ ์ž…๋ ฅ๋œ ๊ฐœ์ˆ˜๋ฅผ ์„ธ์–ด์ฃผ๊ณ  argv๋Š” ์ž…๋ ฅ๋œ ๋‚ด์šฉ์„ ๋ฌธ์ž์—ด๋กœ ์ €์žฅํ•ด์„œ ๊ฐ€์ง€๊ฒŒ ๋จ ! argc๋Š” ๊ฐœ์ˆ˜๋ฅผ .. 2023. 12. 16.
๋ฐ˜์‘ํ˜•