tags:

views:

383

answers:

11

I've read 'The C Programming Language', what should I be doing now? Is there anything important in C that's missed out in the book? Specifically interested in the Linux side of development, so is there anything important I should learn about C in Linux? (I already know some of the basics).

I'm sorry if this question seems a bit general, but i'm a little lost as to what to learn next.

+6  A: 

I'd start off by actually programming something next. Project Euler has good problems to solve that will help you get a better understanding of the language. From there you can move in to Linux-specific C programming, but definitely get your feet grounded in the C basics first.

fbrereto
Project Euler is great, but perhaps not so much for C if you don't have a good arbitrary precision arithmetic library at your fingertips. Sure, they're *possible* to solve in C without using such a library, but often they're unnecessarily annoying.
Greg Hewgill
+5  A: 

The W. Richard Stevens books are the next place to go to, if you're interested in Linux development (they're about general UNIX-alike development, but it's all pretty much applicable to Linux).

Start with Advanced Programming In The UNIX Environment.

caf
+1  A: 

Expert C Programming: Deep C Secrets

Parappa
+13  A: 

Do the book exercises! Reading it is too little.

pmg
+1 I totally agree. Solving is the hard thing.
AraK
When I said I read it, I also meant the exercises too
Dan
Exercise 7-3 (page 156): Revise `minprintf` ... make it accept `%*f`
pmg
Yes - if you "do" the C book - you will know all. Wasn't there a C Answer Book some years ago that provided solutions to the exercises?
codefool
A: 

What's the use in learning things if you're not going to use it. Make a program.

Then when you find you don't know how to do something, look it up or ask here.

The best way to learn is to do.

Pod
+2  A: 

Many answers mention actually programming, and I would start by that if you haven't.

I would also recommend reading quality code. Read, say, bzip2's implementation. Do not worry about not understanding everything on the first pass. There are plenty of little things, idioms, ... than one can pick up even without having read about the algorithm that is being implemented beforehand (the algorithm is interesting too, by the way).

If you are interested in program verification, take a look at ACSL, a specification language to write (and verify) contracts for C functions.

Pascal Cuoq
A: 

Understanding Unix/Linux Programming

This book is really good. It basically covers all the OS specific stuff (specific to Unix and Linux) that isn't covered by the C specification.

This book covers things like signals, threads, inter process communication, network programming, and a bunch of other stuff.

Fredrick Pennachi
+1  A: 

Knowing C is cool. How about learning a different aspect than just the language/syntax?

Two things that strike me are:

  • Socket programming. Write a basic chat client/server. Or a small file-transfer program
  • Multi-programming. Either with processes (fork(), etc - and this would fit nicely with sockets) or
  • pthreads. Learn multi-threaded programming, and what makes them different vs processes to get things done in parallel.

Both of these (sockets, multi-programming) are idea for a single project. You could write a networking program (like a shell), and then modify it to handle multiple connections - making use of processes/threads.

rascher
A: 

In addition to doing the exercises in K&R, I'd start by duplicating a bunch of commonly used linux commands. This is helpful for 2 main reasons.

  1. There are Linux/Unix commands of all levels of complexity. You can start with the easy ones and move on as your skill increases.

  2. You can compare your program's output and running time with the real one to check correctness and efficiency.

Every time I learn a new programming language I duplicate a few linux commands to solidify my ability to solve actual problems in that language.

alesplin
A: 

Reading about programming is a helpful way to get started, but what you read won't really start to come together in that "Aha!" moment until you start to do some programming. Find a task that you need to that could be solved by writing a program (even if that task has already been solved many times) and write a program to do it. The program doesn't have to be composed of pretty or efficient code and the result doesn't have to be attractive. The more you do some programming, the better you'll get and the better your programs will be.

Mike Chess
+2  A: 

If You want deep dive into Linux hacking read already mentioned "Advanced Programming In The UNIX Environment". But IMO this book required some experience before reading it.

I suggest some books about programming tools (used in Linux but not only) like svn, diff, packaging system:

Maciek Sawicki