A git repo containing different examples written in the C programming language. Inspired by Go by Example, Beej's Guide to C Programming, and many other helpful websites and tutorials. This repo is directed at those who already know how to program, or those that have used C but need a refresher.
You can compile the code with any C compiler that supports the ISO C90 standard.
All code that can be compiled has been compiled with gcc -std='c90'
If there are any bugs in the code or information that is incorrect, please submit a PR, an issue via GitHub, or email me (my current email address can be found here. I'm not amazing at C, but I'm doing this so I can understand it better. I appreciate all constructive help and feedback!
- Hello World
- Variables
- Operators
- Constants
- If Statements
- Switch Statements
- While Loop
- Do-While Loop
- For Loop
- Functions
- Scope of Variables
- Static Variables
- Pointers
- Passing Pointers
- Structs
- Pointers to Structs
- Unions
- Arrays
- Strings
- typedef
These are more... "eccentric" examples of behavior in C (Most probably work just as intended, but they may not make immediate sense to the programmer). I'll do my best to explain them, but you should definitely research these on your own, and correct me when I explain things incorrectly.