Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinhoward/did-it-in-c
Learning implementations in C
https://github.com/justinhoward/did-it-in-c
Last synced: 9 days ago
JSON representation
Learning implementations in C
- Host: GitHub
- URL: https://github.com/justinhoward/did-it-in-c
- Owner: justinhoward
- License: mit
- Created: 2016-01-14T18:20:08.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-06T21:31:55.000Z (about 3 years ago)
- Last Synced: 2024-11-08T19:05:09.734Z (2 months ago)
- Language: C
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Did it in C
This repository exists to expand my personal abilities. I have never had a
reason to learn C properly. This will be my effort to implement some algorithms
and data structures in C.I'm sure as I go along, I will learn more about C idioms and best practices, so
this will serve as a record of all my mistakes and progress.## Implementations
- Hello World
- Looping through an array
- Resizable array struct## Things I Learned
- How to write a simple Makefile
- How to organize header files
- Array sizing and size\_t
- Using libcheck
- Adding dependencies on headers to Makefile
- Function declaration order matters if a function is not in the header
- The `realloc` call for resizing a variable## Build Dependencies
- `clang`
- `make`
- `check` [libcheck](https://libcheck.github.io/check/)
- `cpplint` [cpplint](https://github.com/cpplint/cpplint)## Running
To run the examples:
```sh
make
bin/run
```Run the tests
```sh
make test
```## CCLS Language Server
To setup the CCLS language server:
- Install [`bear`](https://github.com/rizsotto/Bear)
- Install [`ccls`](https://github.com/MaskRay/ccls)
- Clean with `make clean`Generate `compile_commands.json`:
```sh
make clean
bear -- make
bear --append make test
```