Learning C

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.

Other urls found in this thread:

gen.lib.rus.ec/book/index.php?md5=8DA872E974D71A3DA307F439DC269560)
twitter.com/SFWRedditImages

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

+1 to this

Book is expensive, anyone got a good PDF?
K&R is good, but it's section on pointers is terrible.

>section on pointers is terrible

why?

Not explained well and rushed examples. Would recommend looking at other resources when you get to that section.

OP here, I just downloaded it from this link (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?

#include

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

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.

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.

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.

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

why

Well you see, a for loop is when you want to iterate something.

"C" in a nutshell, Prinz.

Thank me later.

To draw a six-line asterisk pyramid? Admittedly, his indenting is pretty crap though, and quite to many blank lines too.

/thread
One of the best programming books I've read.

The C Pocket Reference by the same author is also quite good, handy little reference.

unrelated but are there more of these?

Google "o rly books"

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?

I can't find them anymore, but I used to have 'coding drunk' and 'web development with assembly'

oh here it is

Yeah. The one I recommended references the standard libs and pretty much every GCC compiler command-line parameter that you'll ever need.

...

BookZZ.org

K&R comes with a reference manual.

because pointers are such a nebulous subject

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.

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

...

I thought I was literally the only person on the planet that liked this textbook. It fucking owns

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?

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

>39 KB
agreed.

excuse me

Don't know why the 39 KB thing showed up, I didn't type it. Either I had a seizure or something fucked up.

huh

were you a part of it?

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 Sup Forums. I'm kinda interested to see what people are up too.

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