{"id":16352857,"url":"https://github.com/mixelpixel/learn-c-the-hard-way","last_synced_at":"2025-11-20T12:30:18.980Z","repository":{"id":106836276,"uuid":"91311641","full_name":"mixelpixel/Learn-C-The-Hard-Way","owner":"mixelpixel","description":"Zed A. Shaw's C Programming Tutorial","archived":false,"fork":false,"pushed_at":"2018-01-24T18:38:46.000Z","size":264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T18:55:32.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mixelpixel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-15T08:10:04.000Z","updated_at":"2017-05-15T08:46:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"be0ab582-e22e-4668-8565-de576fd74020","html_url":"https://github.com/mixelpixel/Learn-C-The-Hard-Way","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FLearn-C-The-Hard-Way","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FLearn-C-The-Hard-Way/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FLearn-C-The-Hard-Way/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mixelpixel%2FLearn-C-The-Hard-Way/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mixelpixel","download_url":"https://codeload.github.com/mixelpixel/Learn-C-The-Hard-Way/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239619465,"owners_count":19669449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T01:27:51.638Z","updated_at":"2025-11-20T12:30:18.365Z","avatar_url":"https://github.com/mixelpixel.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \"Learn C The Hard Way\" by Zed A. Shaw\nZed A. Shaw's C Programming Tutorial, \"[Learn C The Hard Way](https://learncodethehardway.org/c/)\"\n\n▶︎ Click ▶︎ on ▶︎ the ▶︎ triangles ▶︎ to ▶︎ display ▶︎ extra ▶︎ notes. ▶︎\n\n# Exercise 0: [The Setup](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex0/lecture.md)\n\n\u003cdetails\u003e\u003csummary\u003eMy Setup While Working Through the Course, Notes \u0026 To Do...\u003c/summary\u003e\u003cp\u003e\n\n### I am working with:\n1. macOS Sierra version 10.12.5 (16F73), Kernel Version: Darwin 16.6.0 _through_ macOS High Sierra version 10.13.2 (17C205) Kernel Version: Darwin 17.3.0, and\n2. Terminal.app version 2.7.2 (388.1) through 2.8,\n3. Xcode Version 9.0.1 (9A1004),\n4. `$  cc --version` ---\u003e `Apple LLVM version 9.0.0 (clang-900.0.38)`\n5. As of 6/8/2017 [valgrind](http://valgrind.org/) is still inoperable with macOS Sierra, \u003cstrike\u003eso I am continuing using Ubuntu 16.04.2 LTS on either a persistent USB boot stick, or, as a guest OS in Virtual Box v5.1.22 r115126 (Qt5.6.2), GNOME Terminal 3.18.3 \"A terminal emulator for the GNOME desktop. Using VTE version 0.42.5 +GNUTLS.\u003c/strike\u003e\n  - **UPDATE** 6/15/2017 valgrind 3.13.0 runs on macOS Sierra! I installed w/Homebrew. Seems to work on macOS High Sierra...\n  ```\n  $  valgrind --version\n  valgrind-3.13.0\n  ```\n  - **UPDATE** 1/24/2018 Nope, I updated Homebrew and `valgrind` no longer works, unavailable for OS's newer than Sierra :(\n6. `$  diff -v` ---\u003e `diff (GNU diffutils) 2.8.1`\n7. `$  lldb -v` ---\u003e `lldb-900.0.50.1, Swift-4.0`\n8. `$  splint -help version` ---\u003e `Splint 3.1.2 --- 21 Sep 2017`\n\n### [Zed Shaw's GitHub repository](https://github.com/zedshaw/learn-c-the-hard-way-lectures)\n\nNOTE:\n1. When including quotes from the tutorial I will try and append \"_(ZAS)_\"\n2. Additional reference: https://github.com/mwilliams/lcthw-book\n3. https://www.safaribooksonline.com/library/view/learn-c-the/9780134434452/\n4. Additional C resource: https://www.cprogramming.com/\n\nTODO:\n1. add this to an appropriate section: https://www.go4expert.com/articles/solution-using-scanf-fgets-c-t27148/\n2. Clean up the Tables in ch.5. I like the colspan of html, but prefer the `code` formatting of markdown.\n  - see: https://stackoverflow.com/q/48418548/5225057, an\n  - https://github.com/github/markup/issues/1151\n\n\u003c/p\u003e\u003c/details\u003e\n\n\n***\n\n\n# Exercise 1: [Dust Off That Compiler](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex1/lecture.md)\n\n\u003cdetails\u003e\u003csummary\u003eNotes to myself:\u003c/summary\u003e\u003cp\u003e\n\n- [Difference between `puts` and `printf`](http://stackoverflow.com/a/2454491/5225057)\n  1. `puts` automatically appends a newline.\n  2. `printf` uses \"%s\" style **print f**ormatting.\n\n- Odd, in the command line I can use `$ printf $ \"ab\\bcd\"` to display \"acd\" but `puts` returns \"command not found.\" Not sure why since `man puts` displays the manual. There's also `fputs`.\n- Why the 3 in `man 3 puts`? Answer: https://en.wikipedia.org/wiki/Man_page#Manual_sections (see also `man man` for the `-a` option to display all manual sections).\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eChanges since LCTHW published\u003c/summary\u003e\u003cp\u003e\n\n- Some things have changed since this was written, e.g. `make` reports the same warning without CFLAGS declaration:\n\n  ```bash\n  $  make 1.0\n  cc     1.0.c   -o 1.0\n  ex1.c:3:5: warning: implicit declaration of function 'puts' is invalid in C99 [-Wimplicit-function-declaration]\n      puts(\"Hello world.\");\n      ^\n  1 warning generated.\n  ```\n\n- CFLAGS declared:\n\n  ```bash\n  $  CFLAGS=\"-Wall\" make 1.0\n  cc -Wall    1.0.c   -o ex1.0\n  ex1.c:3:5: warning: implicit declaration of function 'puts' is invalid in C99 [-Wimplicit-function-declaration]\n      puts(\"Hello world.\");\n      ^\n  1 warning generated.\n  ```\n\n[See 1.1.c for a warning free example compiling with or without CFLAGS='-Wall'](01/1.1.c)\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNotes re: CFLAGS\u003c/summary\u003e\u003cp\u003e\n\n- Of note, the `CFLAGS='-WCL4'` compile warns about the unused parameters:\n\n```bash\n$  CFLAGS='-WCL4' make 1.0\ncc -WCL4    1.0.c   -o 1.0\nex1.c:3:5: warning: implicit declaration of function 'puts' is invalid in C99 [-Wimplicit-function-declaration]\n    puts(\"Hello world.\");\n    ^\nex1.c:1:14: warning: unused parameter 'argc' [-Wunused-parameter]\nint main(int argc, char *argv[])\n             ^\nex1.c:1:26: warning: unused parameter 'argv' [-Wunused-parameter]\nint main(int argc, char *argv[])\n                         ^\n3 warnings generated.\n```\n\n- I \"discovered\" this flag option because I accidentally wrote `CFLAGS=\"-WALL\"` (all caps) and got the message \"`warning: unknown warning option '-WALL'; did you mean '-WCL4'? [-Wunknown-warning-option]`\" and tried it. This flag option also warns about the unused parameters. Not sure what other conditions it covers. Also not sure if `$ man make` is where I should be looking to ascertain what these flags are doing, but I think I am invoking the `-W` `-C` `-L` flags with `make`, but not sure what the `4` is for.\n- NOTE: `-WCL4` seems to only be a thing in MacOS, not Ubuntu. No idea why.\n- Explicitly stating there are no parameters in main with \"void\" avoids this warning, e.g.\n\n```c\nint main(void)\n{\n    puts(\"Look, no warning msg!\");\n    return 0;\n}\n```\n\n- ...and apparently so does leaving the parameters list void, e.g.\n\n```c\nint main()\n{\n    puts(\"Look, no warning msg!\");\n    return 0;\n}\n```\n\n- [See 1.2.c for a warning free example using \"void\" and compiling with CFLAGS='-WCL4'](01/1.2.c)\n\n\u003c/p\u003e\u003c/details\u003e\n\n[Exercise 1 √](01/)\n\n\n***\n\n\n# Exercise 2: [Make Is Your Python Now](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex2/lecture.md)\n\n\u003cdetails\u003e\u003csummary\u003eNotes re: `make`, `cc`, `-Wall` \u0026 `-WCL4`:\u003c/summary\u003e\u003cp\u003e\n\n- Hmm... reading `$ man make` didn't help me to understand the `-\"Wall\"` or `\"-WCL4\"`, but this helped some:\n  \u003e \"In this example I did `CFLAGS=\"-Wall\" make ex1` so that it would *add the command line option `-Wall` to the `cc` command that `make` normally runs*\" _(ZAS)_\n\n- So I read `$ man cc` but am still not sure about what is going on here: is `-Wall` like `-W` and `-all`? is `-WCL4` like `-W` `-C` `-L` and `-4` (\"`-04`\"?)? Per the extra credit, I'll do a little more research...\n- I also found this useful: `CFLAGS='-Wall'`\n  \u003e \"is a way to pass \"modifiers\" to the make command. If you're not familiar with how the Unix shell works, you can create these \"environment variables\" which will get picked up by programs you run. Sometimes you do this with a command like export `CFLAGS=\"-Wall\"` depending on the shell you use. *You can however also just put them before the command you want to run, and that environment variable will be set only while that command runs.*\" _(ZAS)_\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eNotes re: `make`, `vim` \u0026 `vi`:\u003c/summary\u003e\u003cp\u003e\n\n- `make` is very particular about tabs not being spaces and end of line. In my ~/.vimrc settings file I had \"set expandtab\" as an option to turn tabs into spaces. I commented this out \u0026 now the \"Makefile\" exercise works :). Basically the same as to be expected:\n\n```bash\n$  make clean\nrm -f ex1\n$  make ex1\ncc -Wall -g    ex1.c   -o ex1\nex1.c:3:5: warning: implicit declaration of function 'puts' is invalid in C99 [-Wimplicit-function-declaration]\n    puts(\"Hello world.\");\n    ^\n1 warning generated.\n```\n\n- For vim: ESC, `:set list`, REUTRN will enable display for end of line as `$` and TABs as `I^`\n- For vim: ESC, `:set nolist`, RETURN will disbale the \"list display\"\n- For vi, I've set the .exrc file accordingly.\n- Additional resources: https://www.gnu.org/software/make/\n- What is a .dSYM directory for? When I run the command make using Makefile, I end up, for example, with the directory ex1.dSYM containing the ex1 binary within /Contents/Resources/DWARF/ including an info.plist in the /Contents/ directory. Ah-ha: [Debug SYMbols](https://stackoverflow.com/a/585298/5225057)\n\n\u003c/p\u003e\u003c/details\u003e\n\n[Exercise 2 √](02/)\n\n\n***\n\n\n# Exercise 3: [Formatted Printing](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex3/lecture.md)\n[Exercise 3 √](03/)\n\n\n***\n\n\n# Exercise 4: [Using a Debugger](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex4/lecture.md)\n\n\u003cdetails\u003e\u003csummary\u003evalgrind install attempt notes\u003c/summary\u003e\u003cp\u003e\n\n## [Introducing Valgrind](https://github.com/mwilliams/lcthw-book/blob/master/learn-c-the-hard-waych5.txt)\n### Installing [Valgrind](http://valgrind.org/) -  v3.12.0 NOT SUPPORTED ENOUGH FOR macOS Sierra.\n\n- **UPDATE** valgrind v.3.13.0 supported on macOS Sierra\n- **UPDATE** not supported for macOS High Sierra :(\n- [Valgrind on macOS Sierra?](https://stackoverflow.com/questions/40650338/valgrind-on-macos-sierra)\n- http://valgrind.org/docs/download_docs.html\n- https://bugs.kde.org/show_bug.cgi?id=365327\n- https://stackoverflow.com/a/43431715/5225057\n- http://valgrind.org/downloads/current.html#current\n  - *md5: 6eb03c0c10ea917013a7622e483d61bb*\n\n- WTAF?\n\n```bash\n$  curl -O http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n100 12.1M  100 12.1M    0     0  1213k      0  0:00:10  0:00:10 --:--:-- 1372k\n$  md5 valgrind-3.12.0.tar.bz2\nMD5 (valgrind-3.12.0.tar.bz2) = 6eb03c0c10ea917013a7622e483d61bb\n$  tar -xjvf valgrind-3.12.0.tar.bz2\n$  cd valgrind-3.12.0\n$  open FAQ.txt\n$  ./configure\n...\n     Maximum build arch: amd64\n     Primary build arch: amd64\n   Secondary build arch: x86\n               Build OS: darwin\n   Primary build target: AMD64_DARWIN\n Secondary build target: X86_DARWIN\n       Platform variant: vanilla\n  Primary -DVGPV string: -DVGPV_amd64_darwin_vanilla=1\n     Default supp files: exp-sgcheck.supp xfree-3.supp xfree-4.supp darwin10-drd.supp darwin16.supp\n\n$  make\n...\nld: symbol(s) not found for architecture x86_64\nmake[3]: *** [memcheck-amd64-darwin] Error 1\nmake[2]: *** [all-recursive] Error 1\nmake[1]: *** [all-recursive] Error 1\nmake: *** [all] Error 2\n$  sudo make install\nPassword:\n...\nUndefined symbols for architecture x86_64:\n  \"___bzero\", referenced from:\n      _hijack_thread_state in libcoregrind-amd64-darwin.a(libcoregrind_amd64_darwin_a-syswrap-amd64-darwin.o)\n      _RRegUniverse__init in libvex-amd64-darwin.a(libvex_amd64_darwin_a-host_generic_regs.o)\nld: symbol(s) not found for architecture x86_64\nmake[3]: *** [memcheck-amd64-darwin] Error 1\nmake[2]: *** [install-recursive] Error 1\nmake[1]: *** [install-recursive] Error 1\nmake: *** [install] Error 2\n$  valgrind ls -l\nvalgrind: tool 'memcheck' not installed (/usr/local/lib/valgrind/memcheck-amd64-darwin) (No such file or directory)\n```\n\n- [possible fix?](http://valgrind.10908.n7.nabble.com/Unable-to-compile-on-Mac-OS-X-10-11-td57237.html)\n- Change: \"coregrind/m_main.c\" from:\n  - `#if defined(VGO_darwin) \u0026\u0026 DARWIN_VERS == DARWIN_10_10` to:\n  - `#if defined(VGO_darwin)`\n```bash\n$  brew install valgrind\nvalgrind: This formula either does not compile or function as expected on macOS\nversions newer than El Capitan due to an upstream incompatibility.\nError: An unsatisfied requirement failed this build.\n```\n\n# OOF-AH!\n- See: [pt1](04/Valgrind_Notes/Valgrind_pt1.md) \u0026 [pt2](04/Valgrind_Notes/Valgrind_pt2.md)\n\n- Oddly, and after all this, I decided to install Ubuntu 16.04.2 LTS on a Virtual Box and go through the same process of installation (note: `md5sum` instead of `md5`) but after a successful `make install` the `valgrind` command was not recognized. WTF? So, I simply resorted to `sudo apt install valgrind` and it works fine on Ubuntu... :\\\n- Aaand the performance blows on the VirtualBox, so I made a persistent USB stick... it's USB2.0 tho, so I might have to get a usb 3.0 cuz it's not that much better :\\\n- Tracking this for using MacOS Sierra with valgrind: https://apple.stackexchange.com/questions/285329/valgrind-for-macos-sierra-on-i7-macbook-air\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eClick here for some fun info on Valgrind\u003c/summary\u003e\u003cp\u003e\n\n- https://dot.kde.org/2006/02/21/interview-valgrind-author-julian-seward\n\n\u003e 1.1. How do you pronounce \"Valgrind\"?\n\u003e The \"Val\" as in the word \"value\". The \"grind\" is pronounced with a short 'i' -- ie. \"grinned\" (rhymes with \"tinned\") rather than \"grined\" (rhymes with \"find\").\n\u003e\n\u003e Don't feel bad: almost everyone gets it wrong at first.\n\u003e ***\n\u003e\n\u003e 1.2. Where does the name \"Valgrind\" come from?\n\u003e From Nordic mythology. Originally (before release) the project was named Heimdall, after the watchman of the Nordic gods. He could \"see a hundred miles by day or night, hear the grass growing, see the wool growing on a sheep's back\", etc. This would have been a great name, but it was already taken by a security package \"Heimdal\".\n\u003e\n\u003e Keeping with the Nordic theme, Valgrind was chosen. Valgrind is the name  of the main entrance to Valhalla (the Hall of the Chosen Slain in Asgard). Over this entrance there resides a wolf and over it there is the head of a boar and on it perches a huge eagle, whose eyes can see to the far regions of the nine worlds. Only those judged worthy by the guardians are allowed to pass through Valgrind. All others are refused entrance.\n\u003e\n\u003e It's not short for \"value grinder\", although that's not a bad guess.\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eGDB, LLDB, Address Sanitizer, LLVM, Splint\u003c/summary\u003e\u003cp\u003e\n\n- [GDB](https://www.gnu.org/software/gdb/): GNU Debugger (Linux)\n- [LLDB](https://lldb.llvm.org/): Low Level DeBugger (OSX)\n- [Address Sanitizer](https://clang.llvm.org/docs/AddressSanitizer.html)\n- [LLVM](https://llvm.org/): no longer an acronym for Low Level Virtual Machine, it's a bunch of tools!\n- [Splint](http://lclint.cs.virginia.edu/)\n- [Splint homebrew](http://brewformulas.org/Splint)\n\n\u003c/p\u003e\u003c/details\u003e\n\n[Exercise 4 √](04/)\n\n\n***\n\n\n# Exercise 5: [Memorizing C Operators](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex5/lecture.md)\n\n\u003cdetails\u003e\u003csummary\u003eOld ch. 5: The Structure Of A C Program\u003c/summary\u003e\u003cp\u003e\n\n- [The Structure Of A C Program](https://github.com/mwilliams/lcthw-book/blob/master/learn-c-the-hard-waych6.txt)\n- see [ex01's extra credit #4](01/extra_credit/4.c) for a breakdown of the components.\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eC Operators\u003c/summary\u003e\u003cp\u003e\n\n### Arithmetic Operators\n| Symbol | Description |\n|:---:| --- |\n`+` | Add\n`-` | Subtract\n`*` | Multiply\n`/` | Divide\n`%` | Modulus\n`++` | Increment\n`--` | Decrement\n\n### Relational Operators\n| Symbol | Description |\n|:---:| --- |\n`==` | Equal\n`!=` | Not Equal\n`\u003e` | Greater than\n`\u003c` | Less than\n`\u003e=` | Greater than euqal\n`\u003c=` | Less than equal\n\n### Logical Operators\n| Symbol | Description |\n|:---:| --- |\n`\u0026\u0026` | Logical and\n`\\|\\|` | Logical or\n`!` | Logical not\n`? :` | Logical ternary\n\n\u003c!-- \u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth colspan=2\u003eLogical Operators\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u0026\u0026\u003c/td\u003e\u003ctd\u003eLogical and\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e||\u003c/td\u003e\u003ctd\u003eLogical or\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e!\u003c/td\u003e\u003ctd\u003eLogical not\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e? :\u003c/td\u003e\u003ctd\u003eLogical ternary\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e --\u003e\n\n\u003c!-- | Logical | Operators |\n|:---:| --- |\n| `\u0026\u0026` | Logical and |\n| `\\|\\|` | Logical or |\n| `!` | Logical not |\n| `? :` | Logical ternary | --\u003e\n\n### Bitwise Operators\n| Symbol | Description |\n|:---:| --- |\n`\u0026` | Bitwise and\n`\\|` | Bitwise or\n`^` | Bitwise xor\n`~` | Bitwise ones compliment\n`\u003c\u003c` | Bitwise shift left\n`\u003e\u003e` | Bitwise shift right\n\n### Assignment Operators\n| Symbol | Description |\n|:---:| --- |\n`=` | Assign equal\n`+=` | Assign plus-equal\n`-=` | Assign minus-equal\n`*=` | Assign multiply-equal\n`/=` | Assign divide-equal\n`\u0026=` | Assign modulus-equal\n`\u003c\u003c=` | Assign shift-left-equal\n`\u003e\u003e=` | Assign shift-right-equal\n`\u0026=` | Assign and-equal\n`\\|=` | Assign or-equal\n`^=` | Assign xor-equal\n\n### Data Operators\n| Symbol | Description |\n|:---:| --- |\n`sizeof()` | Get the size of\n`[]` | Array subscript\n`\u0026` | The address of\n`*` | The value of\n`-\u003e` | Structure dereference\n`.` | Structure reference\n\n\u003c!-- ### Miscellaneous Operators\n- `,` Comma\n- `( )` Parentheses\n- `{ }` Curly Braces\n- `:` Colon\n- `//` Single line comment start\n- `/*` Multi-line comment start\n- `*/` Multi-line comment end --\u003e\n\n\u003c!-- \u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth colspan=2\u003eMiscellaneous Operators\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e,\u003c/td\u003e\u003ctd\u003eComma\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e( )\u003c/td\u003e\u003ctd\u003eParentheses\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e{ }\u003c/td\u003e\u003ctd\u003eCurly Braces\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e:\u003c/td\u003e\u003ctd\u003eColon\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e//\u003c/td\u003e\u003ctd\u003eSingle line comment start\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e/*\u003c/td\u003e\u003ctd\u003eMulti-line comment start\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e*/\u003c/td\u003e\u003ctd\u003eMulti-line comment end\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e --\u003e\n\n\n\u003c!-- | Miscellaneous | Operators |\n|:---:| --- |\n| `,` | Comma |\n| `( )` | Parentheses |\n| `{ }` | Curly Braces |\n| `:` | Colon |\n| `//` | Single line comment start |\n| `/*` | Multi-line comment start |\n| `*/` | Multi-line comment end | --\u003e\n\n#### Miscellaneous Operators\n| Symbol | Description |\n|:---:| --- |\n| `,` | Comma |\n| `( )` | Parentheses |\n| `{ }` | Curly Braces |\n| `:` | Colon |\n| `//` | Single line comment start |\n| `/*` | Multi-line comment start |\n| `*/` | Multi-line comment end |\n\n\u003c/p\u003e\u003c/details\u003e\n\n[Exercise 5 √](05/)\n\n\n***\n\n\n# Exercise 6: [Memorizing C Syntax](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex6/lecture.md)\n\n\u003cdetails\u003e\u003csummary\u003eOld ch. 6: Types Of Variables\u003c/summary\u003e\u003cp\u003e\n\n- [Types Of Variables](https://github.com/mwilliams/lcthw-book/blob/master/learn-c-the-hard-waych7.txt)\n- Interesting notes re: trailing `f` on float numbers: https://stackoverflow.com/q/5026570/5225057\n- `char initial = 'A';` requires SINGLE quotes, double quotes results in an integer assignment\n- Segmentation faults are caused by a program trying to read or write an illegal memory location.\n\n\u003ctable\u003e\n  \u003ctr\u003e\u003cth colspan=2\u003eCommon Print Formatting Types\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e%d\u003c/td\u003e\u003ctd\u003eIntegers\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e%f\u003c/td\u003e\u003ctd\u003eFloating Point\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e%c\u003c/td\u003e\u003ctd\u003eCharacter\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003e%s\u003c/td\u003e\u003ctd\u003eString (Array of\u003cbr\u003eCharacters)\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eC Syntax\u003c/summary\u003e\u003cp\u003e\n\n\u003ctable\u003e\n  \u003ctr\u003e\u003cth colspan=2\u003eC Syntax\u003c/th\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eauto\u003c/td\u003e\u003ctd\u003eGive a local variable a local lifetime.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ebreak\u003c/td\u003e\u003ctd\u003eExit out of a compound statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ecase\u003c/td\u003e\u003ctd\u003eA branch in a switch-statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003echar\u003c/td\u003e\u003ctd\u003eCharacter data type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003econst\u003c/td\u003e\u003ctd\u003eMake a variable unmodifiable.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003econtinue\u003c/td\u003e\u003ctd\u003eContinue to the top of a loop.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003edefault\u003c/td\u003e\u003ctd\u003eDefault branch in a switch-statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003edo\u003c/td\u003e\u003ctd\u003eStart a do-while loop.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003edouble\u003c/td\u003e\u003ctd\u003eA double floating-point data type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eelse\u003c/td\u003e\u003ctd\u003eAn else branch of an if-statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eenum\u003c/td\u003e\u003ctd\u003eDefine a set of int constants.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eextern\u003c/td\u003e\u003ctd\u003eDeclare an identifier is defined externally.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003efloat\u003c/td\u003e\u003ctd\u003eA floating-point data type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003efor\u003c/td\u003e\u003ctd\u003eStart a for-loop.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003egoto\u003c/td\u003e\u003ctd\u003eJump to a label.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eif\u003c/td\u003e\u003ctd\u003eStarts an if-statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eint\u003c/td\u003e\u003ctd\u003eAn integer data type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003elong\u003c/td\u003e\u003ctd\u003eA long integer data type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eregister\u003c/td\u003e\u003ctd\u003eDeclare a variable to be stored in a CPU register.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ereturn\u003c/td\u003e\u003ctd\u003eReturn from a function.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eshort\u003c/td\u003e\u003ctd\u003eA short integer data type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003esigned\u003c/td\u003e\u003ctd\u003eA signed modifier for integer data types.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003esizeof\u003c/td\u003e\u003ctd\u003eDetermine the size of data.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003estatic\u003c/td\u003e\u003ctd\u003ePreserve variable value after its scope exits.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003estruct\u003c/td\u003e\u003ctd\u003eCombine variables into a single record.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eswitch\u003c/td\u003e\u003ctd\u003eStart a switch-statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003etypedef\u003c/td\u003e\u003ctd\u003eCreate a new type.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eunion\u003c/td\u003e\u003ctd\u003eStart a union-statement.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003eunsigned\u003c/td\u003e\u003ctd\u003eAn unsigned modifier for integer data types.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003evoid\u003c/td\u003e\u003ctd\u003eDeclare a data type empty.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003evolatile\u003c/td\u003e\u003ctd\u003eDeclare a variable might be modified elsewhere.\u003c/td\u003e\u003c/tr\u003e\n  \u003ctr\u003e\u003ctd\u003ewhile\u003c/td\u003e\u003ctd\u003eStart a while-loop.\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/p\u003e\u003c/details\u003e\n\n[Exercise 6](06/)\n\n\n***\n\n\n# Exercise 7: [More Variables, Some Math](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex7/lecture.md)\n[Exercise 7](07/)\n\n\n***\n\n\n# Exercise 8: [Sizes and Arrays](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex8/lecture.md)\n[Exercise 8](08/)\n\n\n***\n\n\n# Exercise 9: [Arrays And Strings](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex9/lecture.md)\n[Exercise 9](09/)\n\n\n***\n\n\n# Exercise 10: [Arrays Of Strings, Looping](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex10/lecture.md)\n[Exercise 10](10/)\n\n\n***\n\n\n# Exercise 11: [While-Loop And Boolean Expressions](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex11/lecture.md)\n[Exercise 11](11/)\n\n\n***\n\n\n# Exercise 12: [If, Else-If, Else](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex12/lecture.md)\n[Exercise 12](12/)\n\n\n***\n\n\n# Exercise 13: [Switch Statement](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex13/lecture.md)\n[Exercise 13](13/)\n\n\n***\n\n\n# Exercise 14: [Writing And Using Functions](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex14/lecture.md)\n[Exercise 14](14/)\n\n\n***\n\n\n# Exercise 15: [Pointers Dreaded Pointers](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex15/lecture.md)\n[Exercise 15](15/)\n\n\n***\n\n\n# Exercise 16: [Structs And Pointers To Them](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex16/lecture.md)\n[Exercise 16](16/)\n\n\n***\n\n\n# Exercise 17: [Heap And Stack Memory Allocation](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex17/lecture.md)\n[Exercise 17](17/)\n\n\n***\n\n\n# Exercise 18: [Pointers To Functions](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex18/lecture.md)\n[Exercise 18](18/)\n\n\n***\n\n\n# Exercise 19: [A Simple Object System](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex19/lecture.md)\n[Exercise 19](19/)\n\n\n***\n\n\n# Exercise 20: [Zed's Awesome Debug Macros](https://github.com/zedshaw/learn-c-the-hard-way-lectures/blob/master/ex20/lecture.md)\n[Exercise 20](20/)\n\n\n***\n\n\ncont...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixelpixel%2Flearn-c-the-hard-way","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmixelpixel%2Flearn-c-the-hard-way","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmixelpixel%2Flearn-c-the-hard-way/lists"}