GithubHelp home page GithubHelp logo

yemioke / the-c-programming-language-2nd-edition-solutions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ohkimur/the-c-programming-language-2nd-edition-solutions

0.0 0.0 0.0 599 KB

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 K&R.

License: MIT License

C 99.85% Makefile 0.15%

the-c-programming-language-2nd-edition-solutions's Introduction

The C Programming Language 2nd Edition - Solutions

C/C++ CI

Introduction

The C Programming Language is a very popular book and sometimes people refer to it as K&R. The authors Brian W. Kernighan and Dennis M. Ritchie did a very good job of explaining the core concepts of programming. The focus of the book is the C programming language, however, the approach is general, so it can be extrapolated to other programming languages.

Each chapter of the book contains exercises that could be very helpful for a better understanding of the C language. The exercises are designed so that anybody can solve them with the knowledge acquired up to that exercise.

This repository contains the solutions to the exercises from each chapter of the book. These solutions are meant to be helpful for those who want to learn to program with the C language.

Environment

The source code is not tied up to an IDE, so any text editor will do the job. However, there are useful tasks and settings available for Visual Studio Code. For a better experience using this editor, the C/C++ extension provides some very helpful features specific to the C programming language.

Compilers

To be able to write programs in C, a compiler is required. There are many options available for each operating system.

macOS

The Clang compiler is a very nice choice when using macOS. It is available with Xcode Command Line Tools, which can be easily installed using the following command:

xcode-select --install

Linux

The GCC compiler is a very popular way to build C programs and it is a good choice when using Linux. Each distro has its own set of development tools that comes with the GCC compiler out of the box. The development tools can be installed with the following commands:

Ubuntu / Debian / Debian derivatives
sudo apt-get update
sudo apt-get install build-essential
Arch Linux
sudo pacman -Sy base-devel
Fedora
sudo yum update
sudo yum groupinstall "Development Tools" "Legacy Software Development"

Windows

Because Windows is not a Unix like operating system, Windows Subsystem for Linux (a.k.a. WSL) could be a very good approach when writing C programs. It provides a full Linux system that can make the programming experience much better. The official documentation has a pretty good explanation about how to install WSL.

MinGW Compiler Collection is another good alternative to obtain access to the GCC compiler on a Windows system. The official documentation shows how it can be installed step by step.

Debuggers

A debugger is a tool that can become very handy when trying to find out how a program works or why it doesn't. There are many times when the code will compile successfully because syntactically there are no problems. However, that doesn't mean there aren't logical problems. If that is the case it might be a very good idea to use a debugger.

A very good option is LLDB. It is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++. It converts debug information into Clang types so that it can leverage the Clang compiler infrastructure.

Another very popular option is GDB. It supports the following languages (in alphabetical order): Ada, Assembly, C, C++, D, Fortran, Go, Objective-C, OpenCL, Modula-2, Pascal, Rust.

the-c-programming-language-2nd-edition-solutions's People

Contributors

0xblurr avatar aweebit avatar cyberavater avatar deadrobotdev avatar densel86 avatar duxv avatar everylittlefox avatar iliketohelp avatar illustrofia avatar kotoffski avatar marcelned avatar marcofilimon avatar metalbuild-mnbv avatar ohkimur avatar pipboyguy avatar raedaddala avatar saifeilee avatar slackuj avatar tobiasjdcolvin avatar vladimirfokow avatar ye-chuan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.