c_language:overview
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| c_language:overview [2021/03/11 08:02] – [Things i should check out] utedass | c_language:overview [2022/09/12 00:30] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Things i should | + | ====== C Language ====== |
| + | |||
| + | ====== Things i should | ||
| * [[https:// | * [[https:// | ||
| Line 5: | Line 7: | ||
| * [[http:// | * [[http:// | ||
| * [[https:// | * [[https:// | ||
| + | * [[https:// | ||
| + | * What inline in combination with export and static actually does [[https:// | ||
| + | * [[http:// | ||
| [[http:// | [[http:// | ||
| + | |||
| + | [[http:// | ||
| + | ====== IOCCC ====== | ||
| [[https:// | [[https:// | ||
| + | |||
| + | * [[https:// | ||
| + | |||
| + | ====== 8 phases of translation in C ====== | ||
| + | [[https:// | ||
| + | |||
| + | < | ||
| + | ANSI C translation phases | ||
| + | | ||
| + | |||
| + | +-------------------------------------------------+ | ||
| + | | map physical characters to source character set | | ||
| + | | | ||
| + | | | ||
| + | +-------------------------------------------------+ | ||
| + | | | ||
| + | V | ||
| + | | ||
| + | | join lines along trailing backslashes | | ||
| + | | ||
| + | | | ||
| + | V | ||
| + | | ||
| + | | decompose into preprocessing tokens and whitespace/ | ||
| + | | ||
| + | | ||
| + | | ||
| + | | | ||
| + | V | ||
| + | +------------------------------------------------+ | ||
| + | | execute preprocessing directives/ | ||
| + | | process included files | | ||
| + | +------------------------------------------------+ | ||
| + | | | ||
| + | V | ||
| + | | ||
| + | | decode escape sequences in character constants/ | ||
| + | | ||
| + | | | ||
| + | V | ||
| + | +--------------------------------------+ | ||
| + | | concatenate adjacent string literals | | ||
| + | +--------------------------------------+ | ||
| + | | | ||
| + | V | ||
| + | +------------------------------------------+ | ||
| + | | convert preprocessing tokens to C tokens | | ||
| + | | | ||
| + | +------------------------------------------+ | ||
| + | | | ||
| + | V | ||
| + | +-----------------------------+ | ||
| + | | resolve external references | | ||
| + | | link libraries | ||
| + | | build program image | | ||
| + | +-----------------------------+ | ||
| + | </ | ||
| ====== Right-to-left rule ====== | ====== Right-to-left rule ====== | ||
| + | [[https:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| To decode the expression '' | To decode the expression '' | ||
| <code c> | <code c> | ||
| Line 21: | Line 89: | ||
| char (*(*x())[5])() : returning char | char (*(*x())[5])() : returning char | ||
| </ | </ | ||
| + | |||
| + | ====== Pointer vs Array ====== | ||
| + | They are NOT the same, despite what people say! | ||
| + | |||
| + | <code c> | ||
| + | // Example of char array vs char pointer | ||
| + | char *str1 = " | ||
| + | char str2[] = " | ||
| + | |||
| + | str1[2] = ' | ||
| + | str2[2] = ' | ||
| + | </ | ||
| + | |||
| ====== Const ====== | ====== Const ====== | ||
| Line 28: | Line 109: | ||
| const uint8_t *foo; // Same as above. | const uint8_t *foo; // Same as above. | ||
| uint8_t *const foo; // Constant pointer. Can't change the address it is holding. | uint8_t *const foo; // Constant pointer. Can't change the address it is holding. | ||
| + | </ | ||
| + | |||
| + | ====== stdint.h, printf and scanf ====== | ||
| + | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | <code c> | ||
| + | #include < | ||
| + | #include < | ||
| + | |||
| + | ... | ||
| + | |||
| + | printf(" | ||
| </ | </ | ||
c_language/overview.1615449769.txt.gz · Last modified: 2022/09/12 00:30 (external edit)
