TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Beej’s Guide to C Programming [pdf]

507 点作者 tumblewit大约 4 年前

22 条评论

signa11大约 4 年前
Jens Gustedt&#x27;s &quot;Modern C&quot; (<a href="https:&#x2F;&#x2F;modernc.gforge.inria.fr" rel="nofollow">https:&#x2F;&#x2F;modernc.gforge.inria.fr</a>) is an <i>excellent</i> resource as well.
评论 #26913609 未加载
评论 #26915410 未加载
评论 #26915496 未加载
transient_47大约 4 年前
I stumbled upon this gem a while ago [0] while looking for a decent tutorial and reference to C:<p><i>Stuff that should be avoided: [...]<p>Beej&#x27;s Guide to C: <a href="http:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgc&#x2F;output&#x2F;html&#x2F;singlepage&#x2F;bgc.html" rel="nofollow">http:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgc&#x2F;output&#x2F;html&#x2F;singlepage&#x2F;bgc.html</a><p>Full of mistakes.<p>[...]</i><p>Could someone confirm this? I&#x27;ve seen a lot of threads here on HN praising beej&#x27;s guides so I am somewhat confused.<p>[0] <a href="http:&#x2F;&#x2F;www.iso-9899.info&#x2F;wiki&#x2F;Main_Page" rel="nofollow">http:&#x2F;&#x2F;www.iso-9899.info&#x2F;wiki&#x2F;Main_Page</a><p>edit: Formatting
评论 #26912743 未加载
评论 #26913412 未加载
评论 #26912923 未加载
blunte大约 4 年前
IMO, pointers are less difficult to comprehend than other abstractions, like lambdas are.<p>If you know how to walk down a street and stop at the right street number, then you have used pointers. And if you&#x27;ve ever observed that one tall building may &quot;cover&quot; a range of street numbers, such as 200-220, then you should understand how to move from one 4-byte &quot;value&quot; to the next in an array in memory.<p>Anyway, many more analogies... probably better than this one.<p>Maybe unions could make using pointers a bit more challenging, but again, tall buildings next to short buildings and so on. We do this kind of pointer calculation in real life.
评论 #26912166 未加载
评论 #26912206 未加载
评论 #26912502 未加载
评论 #26912287 未加载
评论 #26914837 未加载
评论 #26916424 未加载
评论 #26912664 未加载
评论 #26913113 未加载
评论 #26912689 未加载
评论 #26914238 未加载
billfruit大约 4 年前
There was a &quot;C Unleashed&quot; book, a massive tome of 1000+ pages written by many famous programmers, many of them who where quite active in comp.lang.c, like Richard Heathfield and CB Falconer, had quite insightful material in it.<p>Any one remember the heyday of comp.lang.c? I wonder what goes on in there now.
评论 #26916218 未加载
评论 #26916004 未加载
评论 #26916503 未加载
评论 #26915676 未加载
评论 #26916156 未加载
评论 #26916146 未加载
dang大约 4 年前
It doesn&#x27;t do the brisk business of the networking one, but there have been at least a couple past threads:<p><i>Beej&#x27;s Guide to C Programming</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26100391" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26100391</a> - Feb 2021 (1 comment)<p><i>Beej&#x27;s Guide to C Programming (2007)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15198093" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15198093</a> - Sept 2017 (79 comments)<p>As long as we&#x27;re talking C programming, I&#x27;d single out this large thread with C Standards committee members from last year:<p><i>Tell HN: C Experts Panel – Ask us anything about C</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22865357" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=22865357</a> - April 2020 (962 comments)
yrgulation大约 4 年前
I commented this before on a previous post on one of beej’s guides: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26100075" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26100075</a><p>These tutorials are the gold standard of tutorials. I wish more content would be as straight to the point and easy to follow.
caseyavila大约 4 年前
&gt; It’s especially insidious because once you grok pointers, they’re suddenly easy. But up until that moment, they’re slippery eels.<p>I&#x27;m sort of a C beginner myself. I understand pointers, and I do remember they clicked in my mind suddenly. The moment before, I didn&#x27;t understand at all. I also love the quirkiness of this guide. Definitely going to give this a read.
评论 #26912273 未加载
rubicon33大约 4 年前
I love Beej’s guide to network programming. Back when I was just starting to learn to code, I wanted to get right down to the low level C stuff and his guide was what I used. It was simple and approachable and I had a running TCP client by the end of the day. It was a thrilling experience for a young novice.
3rly大约 4 年前
I see a lot of people making opinions that clearly shows that they have not audited the entire guide. For the intended audience that the author wanted to reach. I will say that he accomplished it.<p>For anything that one finds as mistakes, the author went out of his way (via references) for the reader to dig further.
tumblewit大约 4 年前
From the creator of the famous Network programming in C guide.
aphrax大约 4 年前
I&#x27;ve enjoyed this guide a number of times but each time I hit a brick wall trying to understand pointers. I&#x27;m still keen to learn but it just doesnt &#x27;click&#x27; for me...<p>Edit: poor grammar
评论 #26912335 未加载
评论 #26914943 未加载
评论 #26915506 未加载
评论 #26912156 未加载
评论 #26912128 未加载
评论 #26912229 未加载
评论 #26913006 未加载
评论 #26912162 未加载
评论 #26912183 未加载
评论 #26912165 未加载
throws23577大约 4 年前
I haven&#x27;t read these 2 books, but would like the opinion of someone who did.<p>[1] C Interfaces and Implementations: Techniques for Creating Reusable Software by David Hanson - HN&#x27;s tptacek seemed to rave about this book, that&#x27;s how I heard of it. Wonder what he thinks of it in 2021.<p>[2] C Programming: A Modern Approach by K. N. King - this one seems to be loved by many. Seems to be more &#x27;beginner-friendly&#x27; than the 1st one I guess.
评论 #26914098 未加载
评论 #26930594 未加载
Spivak大约 4 年前
Is there any guide that operates at the level of the C abstract machine and a real platform because it&#x27;s always really jarring to have lots of hand-wavy statements like<p>&gt; When compiling C,machine codeis generated. This is the 1s and 0s that can be executed directly by the CPU.<p>No! Tell me about how the code is translated into an ELF executable, linked, has its memory laid out by the OS and then executed.<p>&gt; I’m seriously oversimplifying how modern memory works, here. But the mental model works, so please forgive me<p>No! Tell me about how memory works in the C abstract machine which is what you can actually program against and guaranteed by the compiler.<p>&gt; Nothing of yours gets called before main(). In the case of our example, this works fine since all we want to do is print a line and exit<p>No! tell that main is special because it&#x27;s mapped to the _start symbol or at least eventually jumped into by code at that symbol which has an address that&#x27;s stored by the linker in e_entry.<p>Like I might be the weird one but this kind of writing (which is common to seemingly all C texts) confuses me more than if it had just been explained.
DyslexicAtheist大约 4 年前
it actually has working examples for all of the C library calls even math routines. Not sure if it&#x27;s complete but it seems so. This seriously helps bridging the gap between man (2) pages and putting things into working code and only beef I have is that I didn&#x27;t have it 25 years ago. Very cool.
评论 #26916199 未加载
评论 #26912556 未加载
dcchambers大约 4 年前
Beej&#x27;s Guide to Network Programming helped me survive a grad-level computer networking class as a naive undergrad in college.<p>If his guide to C is anywhere near as good it should be an awesome resource.
评论 #26916138 未加载
qwerty456127大约 4 年前
Again, the string chapter is telling us about zero-terminated char arrays&#x2F;pointers and doesn&#x27;t even mention Unicode&#x2F;UTF-8 or safety :-(
评论 #26916241 未加载
emilengler大约 4 年前
A thing I really enjoy about this guide is that it’s close to common C paradigms and practices. Many guides lack this and only show outdated ones.
enahs-sf大约 4 年前
I love C programming. Even though people say it&#x27;s dangerous and easy to shoot yourself in the foot, It really is the simplest and most elegant way forward. That said, having to invent the wheel yourself so much, it is not as time efficient as some more modern languages.<p>I liken it to an artisanal craftsman&#x27;s tool versus a modern multi-tool like a dremel which would be something like python.
评论 #26919878 未加载
mnunez大约 4 年前
Just found out that it has an actively maintained GitHub repository, with 35 or more commits this April alone. <a href="https:&#x2F;&#x2F;github.com&#x2F;beejjorgensen&#x2F;bgc&#x2F;commits&#x2F;main" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;beejjorgensen&#x2F;bgc&#x2F;commits&#x2F;main</a>
dimran大约 4 年前
This is a wonderful book if you want to understand how the OSI model of internet works, clearly illustrated network apis. Man this book was amazing.
评论 #26914211 未加载
Flex247A大约 4 年前
Thank you for posting!
exceltior大约 4 年前
Thanks for sharing this