[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
protip
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 22
Thread images: 2
File: download.jpg (6 KB, 156x204) Image search: [Google]
download.jpg
6 KB, 156x204
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.
>>
File: king - c programming.jpg (236 KB, 540x666) Image search: [Google]
king - c programming.jpg
236 KB, 540x666
>>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;
}
Thread replies: 22
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.