don't use this book if you want to read C, it's shit and a waste of time.
>>51895974
What excellent explinations you provided, this is totally not a shitty opinionated thread.
>>51896007
*explanations
hi zed
>>51895974
Anon, this book was top of the line C education in 1976. And this is even the second edition!?
>>51895974
I'm gonna read this and learn C, just to prove that you're wrong and i'm better than you.
>>51895974
>don't use this book if you want to read C, it's shit and a waste of time.
this book is great
and OP is a fag
The book is not that good, its pretty outdated.
>>51896393
No It's not
>>51895974
FUCK OFF
I read it just recently. They really like their pointer arithmetic.
The thing I didn't like about it were their non-descriptive variable names in the examples. Sure, they are easy enough to figure out if you already know some conventions, but it would likely make things more difficult for a beginner than it really has to.
That said, it has a really good explanation of pointers.
ITT: webcucks who can't even average two ints in C
>>51897860
average 2 ints in java
For me it was a great introduction book but if they used to space they wasted on silly examples sized at 32pt on detailed syntax (i.e complex pointer operations, detailed function usage) it would've been a tens of thousands of times a better book. Also don't know if it was me not being able to focus cuz muh depression or the book itself but they could've cut on the verbose descriptions that spoke alot but said not much. I still have respect for it but I switched to GNU C Reference Manual which goes much more in depth and provides short examples that give you a more clear idea of what that specific component of C you're learning performs.
what the best to learn C?
I already know a lot of the basics but I want to learn the more advanced stuff
>>51898473
Go to GNU C reference manual, but after you learn syntax it becomes about programming theory in general, learn algorithms data structures etc, choose a field like networking, embedded then learn things specific in that area (for ex on embedded systems you can directly write to a certain memory address like*((int *)0xFFFF) = 32;
to put 32 at the address of 0XFFFF, cool huh)
>>51897860
Is there something inherently hard about averaging ints that I don't know?#include <math.h>
int Average(int a, int b) {
double average = ((double) a + (double) b) / 2;
return (int) round(average);
}
I suppose this wouldn't work for huge ints if the default type was 64 bits.
>>51898744
To clarify, it would work for huge ints, but may lose *some* precision. Still better to use doubles than just doing (a + b) / 2, which could easily overflow and give a wildly incorrect result.
>>51898473
http://rutracker.org/forum/viewtopic.php?t=4173427
>>51895974
Bait is so weak
Here is your reply
This book is great and all, but shouldn't be read by someone beginning in programming. I recommend "C Programming: A Modern Approach" as it was my first programming book. very beginner friendly with several extra practice problems that have real world applications.
>>51898744
How wouldn't this work? I don't know why you're using round() or returning as an int#include <stdio.h>
double average(int a, int b);
int main(void) {
printf("%f\n", average(5, 6));
return 0;
}
double average(int a, int b) {
return (double)(a + b) / 2;
}