Show HN: The Little Book of C
github.com char ch;
while ((ch = fgetc(in)) != EOF) {
fputc(ch, out);
}
https://little-book-of.github.io/c/books/en-US/book.html#exa...The return type of fgetc() is `int` and not `char`. This example will not differentiate between end-of-file in input versus reading 0xff. 82.7 appears to be the only example with this issue, all other places with fgetc correctly uses `int`.
----
I found another section with lots of syntax errors, for example:
int x = 10;
int *p = &x;
int pp = &p; // Should be int **pp
https://little-book-of.github.io/c/books/en-US/book.html#add...Most likely because the two asterisks needed for pointer-to-pointer isn't rendering properly.
Be aware that character literals in c, e.g., 'f' or 'A', have type int for probably this reason. From the ANSI C89 spec:
> An integer character constant has type int. The value of an integer character constant containing a single character that maps into a member of the basic execution character set is the numerical value of the representation of the mapped character interpreted as an integer.
However, in C++, they have type char.
Let me carefully review all the code snippets, create tests, and integrate them into the CI/CD pipeline to make sure everything is correct.
Could you help create some GitHub issues? I will fix them in my free time next weekend.
This post about neural networks is from the "Math" book: https://news.ycombinator.com/item?id=45434678.
I'd vote for flagging this submission. It's just AI slop.
There is no obvious authorship attached to this "Little book" which is a tell-tale sign since anybody investing time into actually writing such a book would surely like to claim authorship.
Although I've also been thinking about the overall role of effort in products, art, or any output really. Necessary effort to produce something is / was at least some indicator of quality that means that the author spent a certain amount of time with the material, and probably didn't want to release something bad if it meant they had to put a certain threshold of effort in anyways. With that gone, of course some people are gonna get their productivity enhanced and use this tool to make even better things, more often. But having to expend even more engery as a consumer to find out whether something is worth it is incredibly hard.
> I've been preparing these notes for 20 years, and now it's finally time to put them online.
As much as I would like to believe that, there are too many red flags at this point and you have given little indication that it's true. If you really are an expert in all the fields of your little books, it should be easy for you to provide references/credentials?
No, that's not gatekeeping, as in this day and age, those things become more and more important to be able to separate the sea of slop from the real deal.
I agree in flagging in the cases I have seen, but flagging a C book seems very odd.
This book is open source, open for contributions, and completely free of charge, and anyone with a GitHub account can contribute.