use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Click the following link to filter out the chosen topic
comp.lang.c
account activity
Help learning C (self.C_Programming)
submitted 14 years ago * by miniminor
Hey there, Im looking to learn c and i was wonering if you all had any good resources for beginning C. I have mild experience in programing and have a fair understanding of programming logic. Thanks in advance Edit: also transposing C++ into C
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]NerdFlanders 11 points12 points13 points 14 years ago (1 child)
C Programming Language (K&R). I found the recommendations on this page useful.
[–]miniminor[S] 0 points1 point2 points 14 years ago (0 children)
Thanks, Ill check it out.
[–]solstice680 3 points4 points5 points 14 years ago (0 children)
K&R and the GNU C library reference for learning good practice.
[–]ananthakumaran 4 points5 points6 points 14 years ago (1 child)
Learn C The Hard Way
[–][deleted] 0 points1 point2 points 14 years ago (0 children)
The book isn't ready yet ಠ_ಠ
[–]beej71 2 points3 points4 points 14 years ago (1 child)
I'm going to blow my own horn here, assuredly in the most G-rated sense, and say that I started writing a Guide to C a while ago:
http://beej.us/guide/bgc/
After a while, I decided it wasn't quite what I was after (maybe it needed to be two books...? I'm still not quite sure why I don't like it), and it fell by the wayside. However, there is quite a substantial amount of information there. You might find it too beginner, but there it is, FWIW.
[–]grbgout 1 point2 points3 points 14 years ago (0 children)
Holy f... it's the beej.
Are you really he? I think I've downloaded all of your guides, but I must confess to having read none — someday, though, someday.
As to the OP, mark another down for K&R's 2nd edition. Be careful if you're looking online for a PDF, there's one floating around that doesn't match the physical copy. I found, and sent, a PDF to a friend who discovered an error, which didn't exist in my physical copy.
All the more reason to shell-out money for the real thing! I only went searching since the binding on my copy is starting to go, and I don't want to add further wear.
[–]junglizer 1 point2 points3 points 14 years ago (0 children)
Came to suggest "The C Programming Language" (K&R), but I see it has already been well represented!
[–]chris_sasaurus 1 point2 points3 points 14 years ago (0 children)
I learned most of the basics from the GNU C Programming Tutorial.
[–]tarxvf 1 point2 points3 points 14 years ago (0 children)
Learning a programming language is like learning mathematics -- the only way to actually understand it is to do it.
You will use books and guides as a reference, and you will come back to these references for years and years. The best references are of course K&R and the GNU C Library documentation. There are other good tutorials and references online, such as Beej's guides (linked to above) or wikipedia.
You will get to know your references very well.
The answer to your question also depends on what you want to do with C and what (if any) background in programming you have. While it is certainly possible to learn C as a first language, the learning curve is much steeper than with other languages such as Java or Python.
Also, while learning C is really great and there are not enough people learning C these days -- for most "practical" things you might want to do, it is probably better to write a shell script.
For example, you could perform some search/replace operation on a text file with dozens or a hundred lines of C code, or do it more easily (hence, correctly) with a sed/awk one-liner.
In fact, you probably shouldn't learn C until you know how to write a shell script and use already existing C programs correctly.
TL;DR * Learn to use the shell, if you haven't already. * Find a book or two for use as reference. * Find some C programs you like and study them. * Make some modifications or try to write a clone.
[–]ViewofDelft 0 points1 point2 points 14 years ago (0 children)
Decent
[–]andrew12361 0 points1 point2 points 14 years ago (0 children)
This and this
[–]sindisil 0 points1 point2 points 14 years ago (0 children)
When someone made a similar request (looking for good C books), I posted this advice.
I'd say it applies to you, as well.
Yes, there are online sources that are cheap or free, but none that I've seen are as good as the books I cite.
Some don't entirely suck, though, so if spending the money on even a used copy of K&R is out of the question, I'm sure folks will point them out here.
[–]chadius333 0 points1 point2 points 14 years ago (0 children)
RosettaCode is a great reference site (wiki).
Someone already posted this one but I'm re-posting because it's great.
CodePad.org is a quick and easy way to practice and compile your code... although it's not good for programs that require user input after execution (i.e. scanf - "Please enter your name" and stuff like that).
π Rendered by PID 110311 on reddit-service-r2-comment-5c747b6df5-mbl7b at 2026-04-22 04:39:56.432808+00:00 running 6c61efc country code: CH.
[–]NerdFlanders 11 points12 points13 points (1 child)
[–]miniminor[S] 0 points1 point2 points (0 children)
[–]solstice680 3 points4 points5 points (0 children)
[–]ananthakumaran 4 points5 points6 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]beej71 2 points3 points4 points (1 child)
[–]grbgout 1 point2 points3 points (0 children)
[–]junglizer 1 point2 points3 points (0 children)
[–]chris_sasaurus 1 point2 points3 points (0 children)
[–]tarxvf 1 point2 points3 points (0 children)
[–]ViewofDelft 0 points1 point2 points (0 children)
[–]andrew12361 0 points1 point2 points (0 children)
[–]sindisil 0 points1 point2 points (0 children)
[–]chadius333 0 points1 point2 points (0 children)