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

Learning C

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 45
Thread images: 5

File: lceOAtI.jpg (76KB, 600x787px) Image search: [Google]
lceOAtI.jpg
76KB, 600x787px
So I want to learn C. I already know C# and Python as well as some general programming knowledge, so I'm not a complete beginner. I figured I'd start by learning C89 with K&R. Should I go with a different book or learn a different version of C? I don't have anybody else to ask as nobody I know uses C.
>>
>>56197209

Just use K&R until you can apply it.

And then a book about contemporary C, there's a lot of nice books.
>>
C Programming: A Modern Approach, 2nd Edition is a good supplement
>>
>>56198232
+1 to this
>>
>>56198232
>>56199766
Book is expensive, anyone got a good PDF?
>>56198207
K&R is good, but it's section on pointers is terrible.
>>
>>56200025
>section on pointers is terrible

why?
>>
>>56200091
Not explained well and rushed examples. Would recommend looking at other resources when you get to that section.
>>
>>56200025
OP here, I just downloaded it from this link (http://gen.lib.rus.ec/book/index.php?md5=8DA872E974D71A3DA307F439DC269560) because there's no way I'm paying $150 for a book.
>>
I am with very solid understanding of asm and x86 cpu, is there a book that will suit be better than k&r?

more technical in details?
>>
>>56197209

#include<stdio.h>

int main() {

int i;
int j;
int k;
int counterJ = 5;
int counterK = 1;
char star = '*';

for (i = 0; i < 6; i++) {

for (j = 0; j < counterJ; j++){

printf(" ");

}//end for j

for (k = 1; k <= counterK; k++) {

printf("%c", star);

}//end for k

printf("\n");
counterJ--;
counterK+=2;

}//end for i

printf("\n");

system("pause");

return 0;

}//end main


How is that hard to read?
>>
If you have experience with C, your best bet is just to read an introduction like K&R and then study/write a decently sized program.
>>
>>56201293
I'm a moron, I mean experience programming in a C-type language.
>>
learn C99 instead
>>
Learn C99. C89 is only used for legacy purposes and compatibility with shit compilers like MSVC. C99 is very similar and just a lot nicer to work with. You could also go for C11, but it's just C99 with some minor improvements.
>>
>>56197209

Does anybody know where I can get those joke O'Reilly covers in a decent resolution?
I want to get a few of them printed to hang in my office.
>>
>>56201266

for (i = 0; i < 6; i++) {
}


why
>>
>>56201538

Well you see, a for loop is when you want to iterate something.
>>
>>56197209
"C" in a nutshell, Prinz.

Thank me later.
>>
>>56201538
To draw a six-line asterisk pyramid? Admittedly, his indenting is pretty crap though, and quite to many blank lines too.
>>
>>56198232
/thread
One of the best programming books I've read.
>>
>>56201599
The C Pocket Reference by the same author is also quite good, handy little reference.
>>
>>56197209
unrelated but are there more of these?
>>
>>56201674
Google "o rly books"
>>
>>56201538
are you asking why he didn't just print the line out 6 times or are you asking why he didn't declare i in the for loop?
>>
File: 1457641414287.jpg (112KB, 359x477px) Image search: [Google]
1457641414287.jpg
112KB, 359x477px
>>56201674
I can't find them anymore, but I used to have 'coding drunk' and 'web development with assembly'
>>
File: 1432954218264.png (312KB, 506x662px) Image search: [Google]
1432954218264.png
312KB, 506x662px
>>56201740
oh here it is
>>
>>56201626
Yeah. The one I recommended references the standard libs and pretty much every GCC compiler command-line parameter that you'll ever need.
>>
File: perl6.gif (347KB, 488x640px) Image search: [Google]
perl6.gif
347KB, 488x640px
>>
>>56200025
BookZZ.org

>>56201133
K&R comes with a reference manual.
>>
>>56200091
because pointers are such a nebulous subject
>>
>>56201380
I hear hardly anyone uses C99/C11 though, and there's opinions that C was fucked up in the later revisions. Dennis Ritchie himself supposedly wasn't too happy with the changes.
>>
>>56203130
most of the bell labs people aren't happy with anything though

C99 is fine, it's old enough so almost every compiler supports it

C11 is just asking for compatibility issues
>>
File: CWQ3U5vWoAAgjuR.jpg (39KB, 600x419px) Image search: [Google]
CWQ3U5vWoAAgjuR.jpg
39KB, 600x419px
>>
>>56198232
I thought I was literally the only person on the planet that liked this textbook. It fucking owns
>>
>>56197209
Take C#
Remove classes, generics, inheritance, interfaces, attributes, properties all that shit
Remove garbage collection
Remove batteries included libraries
Replace using libraries with include headers

And you get C.
>>
C Primer Plus or C Programming: A Modern Approach?
>>
>>56203741
That's quite an oversimplification, to say the least. C surely has some low-level features which C# simply doesn't have for various reasons.
>>
>wanting to learn C

It's almost like you don't want to enjoy life...
>>
There was an irc channel that stopped being active today apparently that was dedicated to learning C using K&R

Something like that should get started up again. I was enjoying it
>>
>>56204756
>39 KB
agreed.
>>
>>56204819
excuse me
>>
>>56204873
Don't know why the 39 KB thing showed up, I didn't type it. Either I had a seizure or something fucked up.
>>
>>56204912
huh

were you a part of it?
>>
>>56205320
No, but learned C from K&R. It just sounds like something that would be fun to do, or at least better than 80% of the things on /g/. I'm kinda interested to see what people are up too.
>>
>>56205606
It was fun while it lasted. The problem is that nearly everybody flaked out immediately and the remaining few of us only lasted a couple more days
Thread posts: 45
Thread images: 5


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.