permaculture playing cards*
The moose likes C / C++ and the fly likes Good book for learning C programming Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » C / C++
Bookmark "Good book for learning C programming" Watch "Good book for learning C programming" New topic
Author

Good book for learning C programming

Christopher Laurenzano
Ranch Hand

Joined: Jul 25, 2009
Posts: 85
I'd like to learn C but I wanted to ask if anyone knows of a good book to start with. I came across some folks who said the best one is 'The C programming language, second edition' but some reviews said that it's not for beginners. I am learning Java and UNIX on my Mac and am familiar with programming, but I still consider myself a novice (I'm learning for fun and the intellectual exercise).

So if this book isn't the right one, what else can you recommend?


And while I'm here, I thought that OS X came with a c compiler. Is that correct? I tried to search the man pages for the proper command, but couldn't find anything. If not, does anyone know where I can get one that I could run from the command line in Terminal?

If this is not the proper forum for this post, I apologize. I wasn't sure where it ought to go, and whoever's the moderator, feel free to move it if necessary.
Shawn Smith
Ranch Hand

Joined: Feb 22, 2011
Posts: 41
The K&R book should be fine if you're a beginner. That book, plus Rochkind's advanced UNIX programming kept me going from my first C class through 10 years of professional C programming (albeit a long long time ago).

Cheers,
Shawn
Christopher Laurenzano
Ranch Hand

Joined: Jul 25, 2009
Posts: 85
Thanks, Shawn. One more thing -- do you know if OS X comes with a c compiler? I'm on snow leopard right now. I thought there was some command that would compile c code, (maybe I was on Leopard when I found it). Can you tell me how I would be able to? I think I read something about installing it from Xcode from one of the install DVD's, but not sure.

Almost forgot -- Advanced UINX programming -- would that be a good book to take up after 'Learning the Bash Shell?' I'm reading that right now. But it isn't the final word. So I was wondering if you knew of a book that could be the next step.
Shawn Smith
Ranch Hand

Joined: Feb 22, 2011
Posts: 41
The Advanced UNIX programming book is actually a book about system calls on UNIX and UNIX like systems. It doesn't teach you about the shell, but how, inside of C or C++ to do the low level calls into the operating system.

As far as a good book on Shell programming, I don't know what's current. I learned with the Kernighan and Pike book, "The UNIX Programming Environment", but that was over 20 years ago. I have quite a few books on the subject, but I mostly use them for reference at this point.

OS X doesn't come with a native compiler installed. You can install XCode (http://developer.apple.com/xcode/) and use it to install make and the gnu development tools.

If you're looking for a thicker read that is a good starter for C++, Stroustrup's new book "Programming Principals and Practice Using C++" is a tomb, but covers a lot of ground from the basics through advanced topics. Once you know the basics, Scott Meyers Effect C++ series and Herb Sutters Exceptional C++ series are some of the best I've read on the topic.

Cheers,
Shawn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Good book for learning C programming
 
Similar Threads
Advice for Beginner
Which book
Questions needed
Learning OO concepts & Java 2 for mainframe developers - prefer free
Advice for Beginner