Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

the-c-programming-language-2nd-edition-solutions

> DevOps
Open source

Solutions to the exercises in the book "The C Programming Language" (2nd edition) by Brian W. Kernighan and Dennis M. Ritchie. This book is also referred to as

690 stars0 likes2 views
WebsiteGitHub

About

Solutions to the exercises in the book "The C Programming Language" (2nd edition) by Brian W. Kernighan and Dennis M. Ritchie. This book is also referred to as

The C Programming Language 2nd Edition - Solutions

Solutions to exercises from The C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie, commonly known as K&R.

Getting Started

Prerequisites

You need a C compiler:

macOS:

bash
xcode-select --install

Ubuntu / Debian:

bash
sudo apt-get update && sudo apt-get install build-essential

Windows: Use WSL (recommended) or MinGW.

Building

Build all exercises:

bash
make

Build a specific exercise:

bash
cd chapter_1/exercise_1_01
make hello_world
./hello_world

Clean up:

bash
make clean

Repository Structure

chapter_N/
  exercise_N_XX/
    solution.c      # Solution source code
    file_in.txt     # Input file (if needed)
    file_out.txt    # Output file (if needed)

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Quick start:

bash
make format   # Format your code
make check    # Run all checks before submitting

About the Book

The C Programming Language is a classic programming book. The exercises are designed so that you can solve them with the knowledge acquired up to that point in the book.

These solutions are meant to help those learning C. If you're working through the book, try solving the exercises yourself first!

Tools

  • Editor: Any text editor works. VS Code with the C/C++ extension is recommended.
  • Debugger: LLDB (macOS) or GDB (Linux)
  • Formatter: clang-format

License

This project is open source. Feel free to use these solutions for learning!

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Ccc-languagec-programminglanguage

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理