This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:c [2021/04/07 01:20] nanodano created |
programming:c [2021/04/15 20:23] (current) nanodano |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== General topics ===== | ===== General topics ===== | ||
- | C standards - Original C (1983). C90 (1990), C99 (1999), C11 (2011) | + | ==== Editors ==== |
- | comments (/* */ and // only in C99) | + | |
- | header files - creating your own, header-only programs. C Stdlib headers and how to find them (/include, / | + | ==== Compilers ==== |
- | creating libraries | + | |
- | compiling, linking, ldd, strace, static vs dynamic, linking against built libs with header files, assembly built, C++ built, `extern C` | + | ==== Linkers ==== |
- | debugging | + | |
- | Make and Rake | + | ==== C standards |
- | Packaging an app (Source, Debian package) (See: packaging applications) | + | |
- | inline assembly | + | - Original C (1983). C90 (1990), C99 (1999), C11 (2011) |
+ | |||
+ | ==== comments | ||
+ | |||
+ | (/* */ and \/\/ only in C99) | ||
+ | |||
+ | ==== header files ==== | ||
+ | |||
+ | - creating your own, header-only programs. C Stdlib headers and how to find them (/include, / | ||
+ | |||
+ | ==== creating libraries | ||
+ | |||
+ | ==== compiling | ||
+ | |||
+ | , ldd, strace, static vs dynamic, linking against built libs with header files, assembly built, C++ built, `extern C` | ||
+ | specifying include dirs and library dirs | ||
+ | |||
+ | ==== debugging | ||
+ | |||
+ | ==== Make and Rake ==== | ||
+ | |||
+ | ==== Packaging an app ==== | ||
+ | |||
+ | (Source, Debian package) (See: packaging applications) | ||
+ | |||
===== Code examples/ | ===== Code examples/ | ||
+ | |||
+ | to do | ||
==== hello world ==== | ==== hello world ==== | ||
+ | |||
+ | to do | ||
==== math operations ==== | ==== math operations ==== | ||
- | (**, %) | + | exponents, modulus |
==== control logic ==== | ==== control logic ==== | ||
Line 27: | Line 56: | ||
==== functions/ | ==== functions/ | ||
+ | . | ||
==== linked list/data structures ==== | ==== linked list/data structures ==== | ||
Line 47: | Line 77: | ||
==== bitwise and binary ==== | ==== bitwise and binary ==== | ||
+ | |||
+ | ==== inline assembly ==== | ||
==== random numbers ==== | ==== random numbers ==== | ||
==== working with time, sleep, dates ==== | ==== working with time, sleep, dates ==== | ||
+ | |||
+ | <code c sleep.c> | ||
+ | #include < | ||
+ | |||
+ | int main(int argc, char **argv) { | ||
+ | sleep(2); | ||
+ | return(0); | ||
+ | } | ||
+ | </ | ||
==== malloc and free ==== | ==== malloc and free ==== | ||
Line 77: | Line 118: | ||
==== using SQLite ==== | ==== using SQLite ==== | ||
+ | |||
+ | ==== Get exif info ==== | ||
+ | |||
+ | https:// | ||
==== Embedding Python ==== | ==== Embedding Python ==== | ||
Line 141: | Line 186: | ||
===== More examples ===== | ===== More examples ===== | ||
- | cpp-template.cpp | + | * cpp-template.cpp |
- | _computer-terminal | + | |
- | _decryption | + | |
- | _racing-chars | + | |
- | _roman-and-arabic | + | |
- | age-distribution | + | |
- | armstrong-numbers | + | |
- | array-absurdity | + | |
- | beautiful-strings | + | |
- | bit-positions | + | |
- | calculate-distance | + | |
- | capitalize-words | + | |
- | compressed-sequence | + | |
- | ctemplate.c | + | |
- | data-recovery | + | |
- | decimal-to-binary | + | |
- | delta-time | + | |
- | email-validation | + | |
- | even-numbers | + | |
- | fibonacci-series | + | |
- | file-size | + | |
- | find-a-writer | + | |
- | first-non-repeated-character | + | |
- | fizz-buzz | + | |
- | game-of-life | + | |
- | go-template.go | + | |
- | happy-numbers | + | |
- | hex-to-decimal | + | |
- | hidden-digits | + | |
- | java-template.java | + | |
- | json-menu-ids | + | |
- | juggling-with-zeros | + | |
- | lettercase-percentage-ratio | + | |
- | longest-lines | + | |
- | longest-word | + | |
- | lower-case | + | |
- | lowest-unique-number | + | |
- | mixed-content | + | |
- | morse-code | + | |
- | mth-to-last-element | + | |
- | multiples-of-a-number | + | |
- | multiplication-tables | + | |
- | multiply-lists | + | |
- | n-mod-m | + | |
- | nice-angles | + | |
- | number-of-ones | + | |
- | odd-numbers | + | |
- | penultimate-word | + | |
- | php-template.php | + | |
- | prime-numbers | + | |
- | prime-palindrome | + | |
- | py-template.py | + | |
- | query-board | + | |
- | README.md | + | |
- | remove-characters | + | |
- | reverse-and-add | + | |
- | reverse-words | + | |
- | rightmost-char | + | |
- | roadtrip | + | |
- | roller-coaster | + | |
- | roman-numerals | + | |
- | ruby-template.rb | + | |
- | self-describing-numbers | + | |
- | set-intersection | + | |
- | shortest-repetition | + | |
- | simple-sorting | + | |
- | solution_finder.rb | + | |
- | split-the-number | + | |
- | stack-implementation | + | |
- | string-substituion | + | |
- | sum-ints-from-file | + | |
- | sum-of-digits | + | |
- | sum-of-integers | + | |
- | sum-of-primes | + | |
- | swap-case | + | |
- | swap-elements | + | |
- | the-major-element | + | |
- | trailing-string | + | |
- | unique-elements | + | |
- | word-to-digit | + | |