PDA

View Full Version : Are these good books for learning C?



dragos240
March 27th, 2010, 06:24 PM
"The C programming language by Brian W. Kernighan and Dennis M. Ritchie"
"Visual C++ 6 in 24 hrs by SAMS"
"Borland C++ for dummies"

My dad found these in the back room. He called the first one the C bible.

tica vun
March 27th, 2010, 06:26 PM
No, those are books about C, C++ and visual C++, three different programming languages.

Also, you'll generally want to stay well away from books that try to teach you an IDE instead of a programming language.

jrothwell97
March 27th, 2010, 06:29 PM
For learning C, I'd recommend C for Dummies, Second Edition to get a basic grounding, and then its "all-in-one reference" companion for a more thorough look at certain elements.

If you want to learn the C derivatives (C++, C#, Obj-C, Java, etc.) I recommend learning plain C first, and then learning the others. (Refer to the manufacturer's documentation and tutorials in the case of the last three.)

dragos240
March 27th, 2010, 06:30 PM
No, those are books about C, C++ and visual C++, three different programming languages.

Also, you'll generally want to stay well away from books that try to teach you an IDE instead of a programming language.

What are some good ones for C and C++

gnupipe
March 27th, 2010, 06:33 PM
"The C programming language by Brian W. Kernighan and Dennis M. Ritchie"
"Visual C++ 6 in 24 hrs by SAMS"
"Borland C++ for dummies"

My dad found these in the back room. He called the first one the C bible.

How old are you?

dragos240
March 27th, 2010, 06:34 PM
How old are you?

15, is that really relevant?

gnupipe
March 27th, 2010, 06:36 PM
15, is that really relevant?

I know gyus who started to write malware at the age of 15.

dragos240
March 27th, 2010, 06:37 PM
I know gyus who started to write malware at the age of 15.

Well, that's not my intention.

spibou
March 27th, 2010, 06:44 PM
"The C programming language by Brian W. Kernighan and Dennis M. Ritchie"
"Visual C++ 6 in 24 hrs by SAMS"
"Borland C++ for dummies"

My dad found these in the back room. He called the first one the C bible.
As it has been pointed out already only the first one is about C. It is indeed the C bible. If you're willing to read it slowly and carefully it will serve you fine. For any questions you develop during your learning I recommend the comp.lang.c or alt.comp.lang.learn.c-c++ newsgroups. When you start learning you may find http://c-faq.com a useful resource.

superarthur
March 27th, 2010, 06:47 PM
I just got "The C programming language by Brian W. Kernighan and Dennis M. Ritchie" from Amazon not long ago.
It goes quite well for me at the moment.
Do you know any other programming language at all?

gnupipe
March 27th, 2010, 06:53 PM
"The C programming language by Brian W. Kernighan and Dennis M. Ritchie"
"Visual C++ 6 in 24 hrs by SAMS"
"Borland C++ for dummies"

My dad found these in the back room. He called the first one the C bible.

Maybe your dad can teach you C ?

dragos240
March 27th, 2010, 06:56 PM
I just got "The C programming language by Brian W. Kernighan and Dennis M. Ritchie" from Amazon not long ago.
It goes quite well for me at the moment.
Do you know any other programming language at all?

BASH scripting XD!

falconindy
March 27th, 2010, 07:02 PM
K&R2 is the white bible. Read this book from front to back. Make sure you take the time to write, compile, execute and modify the code examples provided. Also make sure you do at least a few of the exercises at the end of each section. When you're done reading it, read it again.

This is not only an awesome book pertaining to C, but it's a phenomenal example of how all programming books should be written.

gnupipe
March 27th, 2010, 07:08 PM
Dragos had a birthday party last week. :)

superarthur
March 27th, 2010, 08:59 PM
BASH scripting XD!
I think you should go ahead and read K&R then.

ssam
March 27th, 2010, 10:46 PM
i started programming at 10. BASIC on BBC micros. its good to start young.

johnb820
March 27th, 2010, 11:01 PM
Well, that's not my intention.

God knows it is easy to do in C, even unintentionally.

superarthur
March 28th, 2010, 12:00 AM
I wish I started learning programming younger. :(

Simian Man
March 28th, 2010, 12:04 AM
If your dad knows that K&R's book is the C bible (which he is quite right about), then he likely knows programming fairly well. C is certainly not my recommendation for beginning programmers (though it's better than C++), but if your dad knows it, you should be fine.

Those other books sound like garbage to me, but I haven't read them and may be wrong.

And yes, start early :).

matthew.ball
March 28th, 2010, 12:38 AM
I love K&R C, whole heartedly recommend going through it.

I have Bruce Eckel's "Thinking in C++" series (hard copy, 2 books). They were actually the first books I ever read on programming, and would say it benefited me greatly. If you're interested, he has them available for free download on his website (http://mindview.net/Books/books.html#ThinkingInCPlusPlus). In the first book he has a nice section titled "The C in C++" which is a pretty bare introduction to C.

Another possibility if you're interested is to learn all about Makefiles and Debugging. Though I don't have any recommended texts, just search google.

dragos240
March 29th, 2010, 02:00 AM
What is the difference between C and C++. I know they're in the same family. But what are the differences.

RiceMonster
March 29th, 2010, 02:03 AM
What is the difference between C and C++. I know they're in the same family. But what are the differences.

C++ is C with classes. You can do everything you can do in C in C++, but not the other way around.

QwUo173Hy
March 29th, 2010, 02:21 AM
God knows it is easy to do in C, even unintentionally.LOL - that's true :) I thought I was using Duplo bricks when we did a VB module a few years later.

macogw
March 29th, 2010, 06:01 AM
C++ is a bunch of macro preprocessor stuff piled on top of C.

Simian Man
March 29th, 2010, 02:45 PM
C++ is C with classes. You can do everything you can do in C in C++, but not the other way around.


C++ is a bunch of macro preprocessor stuff piled on top of C.

No neither of you are quite right. Though RiceMonster is a hell of a lot closer. C is almost a subset of C++, so most any C program can be compiled as a C++ program. But C++ adds a lot of features including classes, function overloading, operator overloading, namespaces, exceptions, and templates. C++ also tried to clear up some of the dark corners of C and be a little stricter about casts and declarations and such.

The number one thing I miss from C++ when using C is actually templates and not classes, because classes can be emulated with structs and function pointers, but emulating templates can get really nasty.

Bachstelze
March 29th, 2010, 03:46 PM
"The C programming language by Brian W. Kernighan and Dennis M. Ritchie"
"Visual C++ 6 in 24 hrs by SAMS"
"Borland C++ for dummies"

My dad found these in the back room. He called the first one the C bible.

And he's quite right. It should be the only one you'll ever need.


C++ is C with classes. You can do everything you can do in C in C++, but not the other way around.

Wrong. Both are Turing-complete, so anything you can do in one, you can do in the other.

dragos240
March 29th, 2010, 07:59 PM
And he's quite right. It should be the only one you'll ever need.



Wrong. Both are Turing-complete, so anything you can do in one, you can do in the other.

So what is the difference then?

RiceMonster
March 29th, 2010, 08:07 PM
Wrong. Both are Turing-complete, so anything you can do in one, you can do in the other.

That's not what I meant. I meant you can use any C function in C++, but you can't use C++ classes in C.

dwarfolo
March 29th, 2010, 08:15 PM
K&R2 is the white bible. Read this book from front to back. Make sure you take the time to write, compile, execute and modify the code examples provided. Also make sure you do at least a few of the exercises at the end of each section. When you're done reading it, read it again.

This is not only an awesome book pertaining to C, but it's a phenomenal example of how all programming books should be written.
+1
Not to mention the fact that Ritchie was the inventor of C.
I've read this book so many times that I've lost the count!
Excellent, clear and complete, you really can't find anything better.

king.pest
March 29th, 2010, 08:20 PM
So what is the difference then?

The difference in the approach each of these languages take. C++ is an object-oriented language and lets you use some concepts pure C doesn't (like classes and templates).

I'm not a good C programmer, but I'd recommend learning C first, and definitely by reading K&R's book. It's one of the best books on computer programming.

If you're ever interested in C++, you might try with B. Stroustrup's "The C++ Programming Language", but for me it seems much more difficult than K&R.

weichimaster
March 29th, 2010, 08:32 PM
Wrong. Both are Turing-complete, so anything you can do in one, you can do in the other.

That's interesting. Do you have a reference for this? Have most of the major languages been checked for Turing completeness?

Simian Man
March 29th, 2010, 08:37 PM
That's interesting. Do you have a reference for this? Have most of the major languages been checked for Turing completeness?

No it's actually not interesting at all. Every sensible programming language (and a lot of non-sensible ones) are Turing complete, the requirements are extremely minimal.

Bachstelze
March 29th, 2010, 10:03 PM
No it's actually not interesting at all. Every sensible programming language (and a lot of non-sensible ones) are Turing complete, the requirements are extremely minimal.

Yup. It's one of the first things you learn in Languages Theory 101.

doas777
March 29th, 2010, 10:05 PM
I have to caution new programmers away from the RKR C book. it's great for serious CS students, but terrible to try to learn from from scratch. much knowledge is assumed.

lisati
March 29th, 2010, 10:11 PM
That's not what I meant. I meant you can use any C function in C++, but you can't use C++ classes in C.

Exactly. And didn't C++ start life as a preprocessor-style "add-on" for C?

weichimaster
March 29th, 2010, 11:51 PM
Yup. It's one of the first things you learn in Languages Theory 101.
Yeah, a little thought showed that simulating a universal Turing machine in the given language is sufficient.