News for hackers. Stuff that matters.
Re:Modern C [pdf] by xenihn on Monday November 28, 2016 @12:43PM (#13057001)
Do you have any recommendations for books?
Re:Modern C [pdf] by jackhack on Monday November 28, 2016 @02:20PM (#13057667)
I learned C from Kernihan & Richie (K&R) under supervision of experienced developers. I was really lost for a few days, the book is kind of terse. I had been developing in assembly for several years, so C felt like a really high level language. I still recall being baffled by pointers and handles, dealing with segmented memory (this was 386 days, Turbo C on the PC, MPW on the Mac for C & Pascal) It was about a month before things "clicked" and pointers made sense.

I think the follow-up C book I read after that was "Learning C". I don't recall the author's name(s) but I think it was from two brothers. Dan, something? (I'll check my bookshelf when I get home tonight and update here...).

I learned C++ initially as just 'C with Classes'. It was informal, by joining a C++ project already underway, and following the senior developer's guidelines. Instruction was informal, and under supervision of others, yet I hadn't made a complete mindshift to OO until probably six months to a year after using it.

I liked "Thinking in C++" (Bruce Eckel @ http://mindview.net/Books/TICPP/ThinkingInCPP2e.html ) quite a lot -- in fact I re-read it several times about six months apart and it seems I always pick up some new nugget of knowledge every time through. That or I forget what I don't use. Possible.

Keep in mind the newest of these is a decade old, at best. Surely not "modern" C. But after completing a basic tour of K&R C, a reader should be ready for the book at the top of this discussion. And that will transport them into this century.

hope this is helpful.

Re:Modern C [pdf] by pieterr on Monday November 28, 2016 @01:13PM (#13057240)
Re:Modern C [pdf] by joeberon on Monday November 28, 2016 @02:11PM (#13057621)
K&R is amazing, really makes you appreciate how simple C is as a language
Re:Modern C [pdf] by weaksauce on Monday November 28, 2016 @02:06PM (#13057588)
Is that still relevant to how c looks and acts nowadays? I know you will learn a lot from it and it's an excellent book, but surely there is a better reference that is more up to date. Maybe not though.
Re:Modern C [pdf] by joeberon on Monday November 28, 2016 @02:14PM (#13057637)
I think it's still really helpful to learn C and as a reference, but the code has a very terse and difficult to read style that I wouldn't recommend actually coding in, for example this is introduced in the first chapter, before anything is even studied in depth: https://www.dropbox.com/s/4hbwyid5jwen43t/Screenshot%202016-...
Re:Modern C [pdf] by AsyncAwait on Monday November 28, 2016 @03:40PM (#13058225)
I cannot recommend "C Programming: A Modern Approach" [1] enough.

[1] - https://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/...

Re:Modern C [pdf] by hackermailman on Monday November 28, 2016 @08:23PM (#13059953)
CS:App book, from 15-213 at CMU goes well with K&R to teach unsigned/TMIN/Float/pointers at the asm level, gdb, Valgrind to check for mem leaks, compilation gotchas and more. http://csapp.cs.cmu.edu/
Re:Modern C [pdf] by mynameisbahaa on Monday November 28, 2016 @01:31PM (#13057360)
Re:Modern C [pdf] by sn9 on Tuesday November 29, 2016 @12:34AM (#13061070)
K&R is great if you already know how to program.

If you're new to programming, Harvard's CS50x on edx is probably the best introduction to programming online and uses C. You'll learn enough to breeze through K&R and then some.