Adventures in C

So, C, eh?

Yeah. It’s quite an undertaking. Typically, all programming languages are quite similar in the fact that they take variables and manipulate them to produce a certain output. All well and good, I say.

I have chosen C.

My reasoning behind the decision is that the UNIX operations system, as well as Linux (my preference) and several other notable derivatives are implemented in the C language. Knowing how the underlying system works will, I hope, improve my knowledge of my chosen OS.

To get myself started, I picked up a copy of “The C Programming Language” ,more reverently known as the “K&R Book”, back in August, 2007. I’m still on Chapter 1. I will also be digging through O’Reilly’s “Linux System Programming” and “Understanding the Linux Kernel”. I will be annotating them here as well.

With the expectation in mind of being able to start writing simple programs by early-to-mid-2008 , I diligently sat down with a pencil and my book, and began to read and make notes. There are example programming problems interlaced within the chapters of the book that provide ever-increasingly-difficult situations for a new programmer to whet their appetite on, and I decided that it would behoove me to work out the examples as I went along.

That is why I am still in Chapter 1.

I also have the opinion that learning something in the Techno-world without a way to practically apply it is not ideal, which is why I have chosen to include the Kernel book mentioned above.  I hope to be able to deeply engrain my C learning by applying it to something I use daily.

What with two kids, my beautiful wife, my exciting and ever-challenging job, and the necessity of sleep, I have not made progress through the C language as quickly as I would have hoped. On the bright side, however, I am up to the 20th example in Chapter 1 (of which there are 24). All in all, I am learning a significant amount from this book.

I have to admit, although I am still working out Chapter 1’s examples, i have read ahead into Chapters 2 and 3. To make a note, there are instances where the procedures that would solve the examples in Chapter 1 are discussed in later chapters. I have found that quite helpful.

To wit, I have decided that by sharing my “Adventures in C” with others, that it might help me to grow as I read over code again and again, and it may inspire more productivity in my learnings so that I can complete this section of my blog more quickly. As Doron Zeilberger has stated, “the best way to learn is by teaching.” in essence, by sharing my experiences, it should prompt me to learn more of the upshoots, downfalls, and caveats of the language.

As I progress, I will fill in the links here. Currently, none are active (sorry). In the following sections I will NOT be reproducing the texts, but I will reference them, and make mention of the notes, as well as outline the source code that I have created for the examples, and place sample output on each page.

“The C Programming Language”

Chapter 1: A Tutorial Introduction

Chapter 2: Types, Operators, and Expressions

Chapter 3: Control Flow

Chapter 4: Functions and Program Structure

Chapter 5: Pointers and Arrays

Chapter 6: Structures

Chapter 7: Input and Output

Chapter 8: The UNIX System Interface

Throughout the paths I align, I will gladly accept comments and criticisms (but please don’t laugh too hard, I am still learning).

In these travels I hope to present a stable learning path for others who wish to advocate the C programming language or better familiarize themselves with the interworkings of UNIX-based operating systems. I hope that someone can glean a bit of knowledge from my footfalls.