ryanjeong / c_knr Goto Github PK
View Code? Open in Web Editor NEWThe C Programming Language, 2nd Edition, by Kernighan and Ritchie
License: MIT License
The C Programming Language, 2nd Edition, by Kernighan and Ritchie
License: MIT License
κ° μμ μμ μ¬μ©λ ν¨μλ€μ indexing
ν¨μ μμ _λ₯Ό λΆμ¬ μΌλ° νκ²½μμ μ¬μ©ν μ μλλ‘ νμμΌλ,
-ansi optionμ μ¬μ©ν΄ _λ₯Ό μ λΆ μ§μΈ κ²
The functions in stdlib.h and stdio.h have implementations in libc.so (or libc.a for static linking), which is linked into your executable by default (as if -lc were specified). GCC can be instructed to avoid this automatic link with the -nostdlib or -nodefaultlibs options.
The math functions in math.h have implementations in libm.so (or libm.a for static linking), and libm is not linked in by default. There are historical reasons for this libm/libc split, none of them very convincing.
Interestingly, the C++ runtime libstdc++ requires libm, so if you compile a C++ program with GCC (g++), you will automatically get libm linked in.
https://stackoverflow.com/questions/1033898/why-do-you-have-to-link-the-math-library-in-c
κ° μμ μ test codeλ₯Ό μΆκ°νμ¬ κ° μμ λ€μ΄ μ¬λ°λ₯΄κ² λμνλμ§ νμΈν κ².
'\n' -> .. && c != '\n'; μ΄ λ¨κ³μμ κ±Έλ¬μ§
for (i = 0; i < (MAXLINE - 1) && (c = getchar()) != EOF && c != '\n'; ++i) {
line[i] = c;
}
/*
* MAXLINE : 4
* INPUT : H I \n \0
* ---------------------
* i = 0 -> store H, c = H
* i = 1 -> store I, c = I
* i = 2 -> store \n, c = \n
* i = 3 -> escape for statement{ i < (MAXLINE - 1) }, c = \n
* if (c == '\n') {
* line[i] = c;
* ++i;
* }
* i = 4 -> result: H I \n \n
* line[i] = '\0' // ERROR!!(out of range)
*/
TIL ννλ‘ μ 리
μ μ , 곡μ , λμ λΌμ΄λΈλ¬λ¦¬ μμ± λ° μ¬μ© μ 리νμ¬ μ 보 μΆκ°ν κ²
static:
ar: archive
r: make
c: make if it is not exist,
shared:
dynamic:
references
[1] https://www.joinc.co.kr/w/Site/C/Documents/Make_Library
[2] https://sens.tistory.com/33
μ΄μ λΈλ¦¬ λ¨μμ μ½λ λΆμ
μλ μ°¨μ΄ λ°μ μ΄μ μΆκ°λ‘ κ²μ
int a = 10;
printf("%f", a); /* 0, not 10 */
castsκ° λ°μνλ κ²μ΄ μλ, va_arg 맀ν¬λ‘μμ λ©λͺ¨λ¦¬μ ννλ κ°μ νμ λ¬Έμκ° κ°λ¦¬ν€λ ννλ‘ κ°μ Έμ€κΈ° λλ¬Έμ,
0x0000000A κ°μ IEEE 754 νμ€μ λ§κ² κ°μ Έμ κ°μ΄ 0(λ§€μ° μμ κ°)μΌλ‘ ννλ¨μ μΆκ°λ‘ μ€λͺ
ν κ²
gcc -> Ctrl + Shift + B -> Makefile(μ½λ λΆλ¦¬ λ° μλ‘ λ€λ₯Έ λλ ν 리) -> λλ²κ±° -> CMake
C89 C90 C99 C11
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.