{"id":32789417,"url":"https://github.com/edulandoni/c-programming-a-modern-approach-2e-exercises","last_synced_at":"2026-07-06T10:31:01.510Z","repository":{"id":319773401,"uuid":"1079554829","full_name":"edulandoni/c-programming-a-modern-approach-2e-exercises","owner":"edulandoni","description":"Exercises and notes for C Programming: A Modern Approach (2nd Edition) by K. N. King. Code in C17.","archived":false,"fork":false,"pushed_at":"2025-12-18T23:15:12.000Z","size":1726,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-21T22:58:00.880Z","etag":null,"topics":["book-exercises","c","c-language","c-programming-a-modern-approach","kn-king","solutions","study-","study-note"],"latest_commit_sha":null,"homepage":"","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/edulandoni.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-20T02:35:24.000Z","updated_at":"2025-12-18T23:15:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"e18f71d6-fd48-4a9d-8a19-91f4992cd8ee","html_url":"https://github.com/edulandoni/c-programming-a-modern-approach-2e-exercises","commit_stats":null,"previous_names":["edulandoni/c-book"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/edulandoni/c-programming-a-modern-approach-2e-exercises","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edulandoni%2Fc-programming-a-modern-approach-2e-exercises","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edulandoni%2Fc-programming-a-modern-approach-2e-exercises/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edulandoni%2Fc-programming-a-modern-approach-2e-exercises/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edulandoni%2Fc-programming-a-modern-approach-2e-exercises/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edulandoni","download_url":"https://codeload.github.com/edulandoni/c-programming-a-modern-approach-2e-exercises/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edulandoni%2Fc-programming-a-modern-approach-2e-exercises/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35187624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["book-exercises","c","c-language","c-programming-a-modern-approach","kn-king","solutions","study-","study-note"],"created_at":"2025-11-05T10:01:35.063Z","updated_at":"2026-07-06T10:31:01.480Z","avatar_url":"https://github.com/edulandoni.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C Programming: A Modern Approach (2nd Edition) — Exercises\n\nPractice repository for exercises from K. N. King’s *C Programming: A Modern Approach* (2nd ed.). Goals: disciplined C17 practice, reproducible builds with make, strict warnings, and basic tooling.\n\n## Quick Setup\n\n- **Toolchain:** Clang or GCC, make. Optional: gdb and valgrind.\n- **Fedora**\n    \n        sudo dnf groupinstall -y \"Development Tools\"\n        sudo dnf install -y clang gcc make gdb valgrind\n\n- **Verify**\n    \n        clang --version || gcc --version\n        make --version\n\n## Repository Layout\n\n        .\n        ├── c01/\n        │   ├── e01/\n        │   │   ├── main.c\n        │   │   └── Makefile\n        │   └── e02/\n        │       ├── main.c\n        │       └── Makefile\n        ├── common.mk        # shared flags\n        ├── Makefile         # convenience targets to run any exercise\n        └── README.md\n\n## Building and Running\n\nEach exercise folder is standalone with its own Makefile.\n\n- **From repo root** (replace `c01/e01` with the target):\n    \n        make DIR=c01/e01 run\n\n- **Inside an exercise folder**:\n    \n        make run     # build and execute\n        make clean   # remove build artifacts\n\n## Compiler Flags\n\nStrict by default.\n\n- Warnings: `-Wall -Wextra -Wpedantic -Werror`\n- Standard: `-std=c17`\n- Debug: `-O0 -g`\n- Sanitizers (Clang/GCC): `-fsanitize=address,undefined` (when available)\n\nThese are centralized in `common.mk`.\n\n## Debugging and Analysis\n\n- **GDB**\n    \n        make DIR=c01/e01 debug     # starts gdb ./build/main\n\n- **Valgrind**\n    \n        make DIR=c01/e01 memcheck  # valgrind --leak-check=full ./build/main\n\n## Style\n\n- One exercise per folder named `cNN/eMM`.\n- Single entry point `main.c` per exercise unless the book suggests more files.\n- No global state unless required by the exercise.\n- Short functions, clear names, and consistent formatting (`clang-format` optional).\n\n## Common Makefile (`common.mk`)\n\nPut this file at repo root.\n\n        # common.mk\n        CC ?= clang\n        CSTD ?= c17\n        WARN := -Wall -Wextra -Wpedantic -Werror\n        DBG  := -O0 -g\n        SAN  := -fsanitize=address,undefined\n        CFLAGS ?= -std=$(CSTD) $(WARN) $(DBG) $(SAN)\n        LDFLAGS ?= $(SAN)\n\n        BUILD_DIR ?= build\n        TARGET ?= $(BUILD_DIR)/main\n        SRC ?= main.c\n\n        $(BUILD_DIR):\n        \t@mkdir -p $(BUILD_DIR)\n\n        $(TARGET): $(SRC) | $(BUILD_DIR)\n        \t$(CC) $(CFLAGS) $(SRC) -o $(TARGET) $(LDFLAGS)\n\n        .PHONY: run clean debug memcheck\n        run: $(TARGET)\n        \t./$(TARGET)\n\n        debug: $(TARGET)\n        \tgdb ./$(TARGET)\n\n        memcheck: $(TARGET)\n        \tvalgrind --leak-check=full --show-leak-kinds=all ./$(TARGET)\n\n        clean:\n        \t@rm -rf $(BUILD_DIR)\n\n## Exercise Makefile (template)\n\nPut this file inside each `cNN/eMM/` folder.\n\n        # cNN/eMM/Makefile\n        include ../../common.mk\n        SRC := main.c\n\n## Root Makefile (convenience)\n\nAllows running any exercise from repo root with `DIR=...`.\n\n        # Makefile (root)\n        .PHONY: run clean debug memcheck\n        run:\n        \t@$(MAKE) -C $(DIR) -f Makefile run\n        clean:\n        \t@$(MAKE) -C $(DIR) -f Makefile clean\n        debug:\n        \t@$(MAKE) -C $(DIR) -f Makefile debug\n        memcheck:\n        \t@$(MAKE) -C $(DIR) -f Makefile memcheck\n\n## Troubleshooting\n\n- Missing headers: install “Development Tools”.\n- Sanitizer not supported: remove `-fsanitize=...` in `common.mk`.\n- Prefer GCC: set `CC=gcc`.\n\n## License\n\nMIT. See `LICENSE`.\n\n## Credits\n\nExercises from K. N. King’s book. For personal study and notes.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedulandoni%2Fc-programming-a-modern-approach-2e-exercises","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedulandoni%2Fc-programming-a-modern-approach-2e-exercises","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedulandoni%2Fc-programming-a-modern-approach-2e-exercises/lists"}