TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: An Advanced C Tutorial

12 pointsby SeriousGuyalmost 15 years ago
Can any one point me to an Advanced C tutorial?<p>I already know C++ quite in-depth but unfortunately never got to learn C. I was directly taught C++ in my high school, and then I went on to Matlab, Python, Java and finally advanced C++ (STL, why not to add default arguments in an overloaded virtual function, how virtual pointer table works and stuff).<p>Thus now I wish to learn C really in depth!, this is partly by ongoing discussion about C++ which I can clearly identify with.

10 comments

mahmudalmost 15 years ago
Advanced C, C Traps and Pitfalls, and The Standard C Library.<p>Those are the classics.<p>C Interfaces and Implementations is over-recommended by people who haven't read it. It's a literate book that consists of heavily commented code. The comments distract from the prose and you're better off getting the library sources and jumping through it with ctags.<p>They faithfully address all of C's quirks. It's such a little language that most quirks lurk in the syntax and machine-specific parts, like storage classes, pointers, and its crappy little type system. But to master C fully you will need to learn some assembly and play with systems software. Try to replace libc with your own standard library and see how far you go.<p>Write something you care about in C. Small binary analysis utilities are a fun way; write an ELF parser or something. It excels in bit-manipulation. However, doing GUIs in C or processing strings would be an exercise in boredom.
szalmost 15 years ago
The C Programming Language (aka K&#38;R)<p><a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_(book)" rel="nofollow">http://en.wikipedia.org/wiki/The_C_Programming_Language_(boo...</a>
评论 #1521516 未加载
zvrbaalmost 15 years ago
You didn't tell us how well you learned C++. Do you understand pointers and how to manually build simple binary search trees and linked lists?<p>You see, C is a really small language and "learning it in depth" includes learning arcane rules, such as what constitutes undefined behavior, what names are reserved, etc.<p>I would recommend reading the "C Interfaces and Implementations" book by David Hanson. Another book that I'd recommend is "Expert C Programming (dark C secrets)" by van der Linden.
评论 #1521556 未加载
pietrofmaggialmost 15 years ago
C is a simple language with some pearls and a lot of corner cases. For the corner cases "C. Puzzle Book" by Alan R. Feuer it's a funny read with a lot of oh-oh moments.<p>For the pearls... well I can give you a couple: - sizeof() macro is a good friend - ISO C99 &#60;stdint.h&#62; introduces Exact-width integer types <a href="http://en.wikipedia.org/wiki/Stdint.h" rel="nofollow">http://en.wikipedia.org/wiki/Stdint.h</a>
评论 #1521564 未加载
jonjackyalmost 15 years ago
After K&#38;R, the most helpful book for me was Expert C Programming: Deep C Secrets by Peter van der Linden. He even gives a little preview of C++.
vineet7kumaralmost 15 years ago
My advice, First of all do not look for an <i>advanced</i> C tutorial. Second, Go and grab a copy of Kernighan &#38; Ritchie's C programming language book (commonly known as the KnR book). Third, <i>Do</i> this book ... (yeah, don't just read it, do it).
tmshalmost 15 years ago
<a href="http://www-inst.eecs.berkeley.edu/~cs61c/su10/" rel="nofollow">http://www-inst.eecs.berkeley.edu/~cs61c/su10/</a><p><a href="http://neverball.org/download.php" rel="nofollow">http://neverball.org/download.php</a><p><a href="http://bellard.org/" rel="nofollow">http://bellard.org/</a>
antichaosalmost 15 years ago
I learned a lot from IOCCC winning entries. (<a href="http://www0.us.ioccc.org/years.html" rel="nofollow">http://www0.us.ioccc.org/years.html</a>)
hchoalmost 15 years ago
If you know C++ in depth, you aleady know C at a professionally usable level, or at least get there with a couple of projects. C is a subset of C++ anyway. True, there are minor differences hera and there, but shouldn't really be deadly.<p>I guess the more difficult part will be to transition from object oriented to procedural paradigm.
评论 #1521573 未加载
eandealmost 15 years ago
another book online link <a href="http://www.phy.duke.edu/~rgb/General/c_book/c_book/index.html" rel="nofollow">http://www.phy.duke.edu/~rgb/General/c_book/c_book/index.htm...</a>