views:

653

answers:

11

I absolutely loved Dive Into Python when I picked up Python.

In fact, "tutorials" such as Dive Into Python work really well for me; short brief syntax explanations, and plenty of examples to get things going.

I learn really well via examples.

I have programming experience in Java, Scheme, Python, PHP, Javascript, etc.

Is there anywhere you would recommend online to quickly pick up the C programming language, and best practices?

Thanks!

+1  A: 

Best practices for programming in C

rahul
+27  A: 

The C Programming Language - Kernighan & Ritchie

Taylor Leese
I don't consider as a tutorial book.A reference, yes, but not a tutorial.
H_I
Taylor Leese
Of course it is a tutorial. I learned C from iit as did most of the C programmers I know.
anon
Chapter 1 is even titled as a tutorial. In my edition ch. 1 was 29 pages long with about 15 actual programs most of which were under 20 lines of code.
Tuzo
Steve S
I agree that this isn't a very good tutorial book. At first glance it appears to be a tutorial book, but the truth is it doesn't go into depth on any the of the subjects it covers. Most topics are limited to one brief example at best, and there is no real help with the pitfalls that are easy to fall into with C. I remember the sections related to C-strings being notoriously bad about this. Now that I am more familiar with C, the book is more useful. It serves much better as a refresher on how to do something when you already know how, but just can't remember the exact way to do it.
Swiss
Nick
Andrei Ciobanu
A: 

I think the MAME source code is a good C code example to play with. It is available for many platforms, and contains all sorts of cool things to look at and learn from.

So, get it, compile it, then play with it. Ultimately, you should try to fix a bug.

BenB
+4  A: 

CProgramming.com

is one of the best places to learn C is.

It has clear and concise tutorials about

They also have small Quiz at the end of each chapter.

The K & R is simply the best (but I guess you wanted some online tutorial).

TheMachineCharmer
+1 That site actually helped me a lot!
Andrei Ciobanu
A: 

If you really want an online tutorial you can try http://einstein.drexel.edu/courses/Comp_Phys/General/C_basics/. It covers the basics and also points out some general C conventions.

That said, K&R is the Bible and if you are serious about learning C then it is almost mandatory reading.

Tuzo
+1  A: 

C-FAQ

pierr
+1  A: 

I might get flamed for this, but I learnt C using Dan Gookin's C for Dummies. The book is funny, well-written and very, very good. It's a bit short on "meaty stuff", so if you're already a programmer, it's probably too basic for you, but for the beginner, I have yet to see a book as good as this one.

I learnt C from this book first, and followed that up with the K&R book already mentioned, which is also excellent, if a bit terse and dense.

Chinmay Kanchi
A: 

When I learned C in the late 1980's I preferred Kochan's Programming in C (to K&R and a couple other lesser books). I see it's up to a third edition now, and there is a more recent version for Objective C.

GreenMatt
+1  A: 

I agree with the answers above and would like to add that by practicing you can learn a lot. write short codes, post questions, look at other people questions. it will help you a lot.

rashid
A: 

An interesting place to learn C can be #C channel on irc.freenode.net . The community there helped me a lot taking my first steps, and feedback for your questions is usually "real-time".

Andrei Ciobanu
A: 

Install an open source unix operating system. Use it. Tweak it. You'll be sitting on a mountain of C code organized into projects of all sizes, all easily available as source. if you don't make an effort to stay in the user category, you're bound to make incremental inroads into C and keep the learning process 100% practical.

The great advantage of this approach is that, since programming techniques, code structure and alike are extremely volatile among project, you get to see very early what works in which circumstances. It may require more active participation (asking questions on mailing lists or programming sites) than following a course outlined by a book author, but you'll probably pick up some idioms useful in the real world earlier.

At least that's the way I got into C, and it was fun, relevant and rewarding every single minute (fun rhymes with frustrating, well, learning hurts).

just somebody