chabulhwi / knk-solutions

My solutions to the exercises in K. N. King's C programming book

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

knk-solutions

This is the repository for my solutions to the exercises in "C Programming: A Modern Approach," second edition by K. N. King. You are free to reuse the content under the terms of Mozilla Public License Version 2.0.

I wrote the source code in the Linux kernel coding style.

Shell scripts

The shell scripts are in the scripts directory.

aspell.sh

Check the spelling of each Markdown document and C source code.

indent.sh

Format the C source code according to the Linux style.

The manpage of the indent command says that the style is equivalent to the following settings:

-nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4
-cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai
-saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1

When a statement is broken across two lines, the second line is indented by a number of additional spaces specified by the -ci option. Note that I removed the -ci4 option because I want to indent the second line by a tab instead.

The default style of indentation is to use tabs, which is specified by the -ut option. Since this option is the default, I don't have to explicitly specify it.

About

My solutions to the exercises in K. N. King's C programming book

License:Mozilla Public License 2.0


Languages

Language:C 97.2%Language:Makefile 1.7%Language:Shell 1.1%