tags:

views:

2791

answers:

16

Hello,

I've taken a few courses on C, C++ and data structures back a few years ago but never got to use that knowledge. Nothing advanced, just simple programming concepts that you'd learn in an introductory class.

Now I've transferred into a Computer Science major as junior, and all of a sudden realized that I'll need that knowledge, and in good condition, to pass some of the classes.

Question is, where to start and what to do? Should I just buy a textbook and work through all of its exercises? Which book to pick? What if I get stuck and there's no solution and nobody to ask advice from? Should I look up some online tutorials, but again, how reliable are they?

In essence, I'm looking for a quick and reliable way to learn enough C/C++ to be comfortable completing exercises with it.

Edit: Should I bother learning C or just learn C++? I gravitate towards just learning C++.

Also, are online lectures of any good? Which ones?

+14  A: 

First step: stop saying "C/C++". They're extremely different languages; despite the fact that they share a lot of syntax, "proper" C++ is written very very differently from "proper" C, and in my experience being good at one actually ends up hurting you when you try to do the other (due to the differing paradigms), unless you're very experienced in both.

There's nothing "wrong" per se with either language, its just that (in my opinion, at least), C practically has more in common with, say, FORTRAN than it does with C++.

Dark Shikari
Dark,I am aware of the difference and my side question (that I didn't type) is whether to learn C before C++ or ignore C altogether. Many classes in universities use C for assignments, others use C++. When I typed "C/C++" I was simply referring to both languages (just as I'd type "PHP/ASP").
DV
+5  A: 

In regards to books, I recommend The C Programming Language and The C++ Programming Language.

Thomas Owens
+10  A: 

online ressource should be

http://www.cplusplus.com/doc/tutorial

for a first start

after this I really recommend to implement some hobby-mini-projects based on boost

http://www.boost.org/

boost is a well written extension of c++ and all modern features are used inside, so you will see and examine real live examples while coding your own mini project.

Last warning: choose a real limited scope for your first project

Peter Parker
Thanks for suggesting boost! It looks like what I might need.
DV
I second the recommendation for Boost; it's very powerful.
Phoenix
+15  A: 

For C: K&R's "The C Programming Language" is a must.

For C++: Books by Scott Meyers are quite popular. "Effective C++", "More Effective C++", "Effective STL".

Additionally (or alternatively), I would recommend the lesser-known "Programming in C++" by Stephen Dewhurst and Kathy Stark, which has the advantage of being (relatively) short.

Other than books, I would say to use your skills as often as possible. Use it or lose it, as they say. For me, it helped to have specific projects to work on that required me to study areas of programming I was not familiar with. Actually using programming to do things has boosted my skills tremendously.

And if you get stuck, of course come back to Stack Overflow.

Phoenix
Although I have no experience with these books, I know some people who love them. If I ever do really intense C++, I think these would be on the top of my "to get" list, but I haven't had a need yet.
Thomas Owens
If you're doing much of anything with C++, let alone "intense C++," these are good books.
Kris Kumler
I wold not start with Scott Meyers books, as they cover more than just the basic inner workings, and go into "gotcha" territory possibly making you think C++ is more complicated than it really is.I personally liked Lippman style on C++ Primer when I was starting.
njsf
I recommend you avoid "Progammming in C++." It may explain the language syntax, but it does a poor job of teaching anything about how to program well in C++
AShelly
+9  A: 

Here is a link to Bruce Eckel's excellent books (free online) on Thinking in C++: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

Btw, I'd suggest skipping C altogether.

torial
A: 

You may want to read some of the C and C++ books by Herb Schildt. (I have C: The Complete Reference)

Edit: By the way, I'd recommend learning both C and C++. C is a smaller language and learning C++ will be easier if you already know C. You do have to watch out though because the features of C still exist in C++ but some are obsolete and you should learn the new and improved way of doing things. (For example, classes, virtual functions, and vectors should be used where appropriate instead of structs, function pointers, and static arrays.)

da_code_monkey
KTC
I have a copy of C++ From The Ground Up by Herb Schildt and I've been pretty happy with it personally.
Jay
Agreeing with KTC here: Many people consider Herb Schildt's books to be easy to understand, enjoyable, and wrong. Don't trust what he writes.
Thomas Padron-McCarthy
+1. http://www.developerdotstar.com/community/node/781
torial
+6  A: 

You should stop using C/C++ together C and C++ are two totally different languages. C++ is far more complex. Starting with C would be an easier first step. To learn C++ requires that you also learn the object-oriented paradigm, which is an excellent way of decomposing problems, but also more work.

In addition to Scott Meyers "Effective C++" and "More Effective C++", there are Bruce Eckel's free online books "Thinking in C++" volumes 1 and 2.

Leonard
+2  A: 

In addition to the great books suggested

I would suggest a community of developers that can answer questions:

  1. Of Course stack overflow
  2. C++ Learning Community A forum of beginners.
  3. Usenet groups c++ Moderated
Martin York
+2  A: 

I have always been happy with the C++ Primer (Amazon) by Stanley B Lippman. And have bought multiple editions. You might also consider not so much concentrating on the language c++ but on Object Oriented Development in general

Harald Scheirich
+2  A: 

Hi DV,

Here are some C++ book recommendations if you decide to go with that option.

The book "C++ Primer Plus" by Stephen Prata is pretty good, I have been working through it lately in an effort to come back up to speed with C++. It is thorough and doesn't assume too much (good for beginners like me). The similarly-named book "C++ Primer" by Stanley Lippman is supposed to be good as well. On Amazon the book by Stephen Prata was rated slightly higher so that's the one I went with and wasn't disappointed.

I would actually NOT start out with "The C++ programming language" by Stroustrup to be honest because it's hard to "get it" as a beginner from that book alone, at least it was for me. It's good as a reference though.

By all accounts, the following book is excellent, although I haven't read it yet (probably my next book purchase):

Accelerated C++: Practical Programming by Example by Koenig and Moo.

Check out the reviews on Amazon, the approach is to get down and dirty and just write some code. You will pick up the nitty gritty details as you go. By the way, this is often the recommended approach to learning c++ - take it slow and write some code. It's a huge language and there's really too much to learn all at once.

The books by Meyer (effective c++, more effective c++, etc.) are very good - but I would say they target more of an intermediate programmer as opposed to a beginner.

Bruce Eckel's "Thinking in C++" is by all accounts very good and the price is right (free download).

Good luck!

unintentionally left blank
+1  A: 

One of the most helpful things for me was/is Bjarne Stroustrup's homepage. He is the creator of C++. Quite a lot of programmers don't know what the differences between C and C++ are, so don't worry about not learning one or the other unless you know exactly what you want to do as a developer. They are surprisingly different and geared for different tasks.

After you know the basics well, start seeking out best practices. They are no-nonsense rules that someone smarter than you and me wrote to keep less experienced programmers from making dumb mistakes. My favorite C++ resource for this is the Joint Strike Fighter Air Vehicle Coding Standards. While some points can be subjective, if you follow the guidelines you will be a great programmer.

I'd highly suggest seeking out C resources, too. The knowledge comes in handy. Search for well know C projects, like the Linux Kernel, GNOME, oh, and check out the POSIX standards while you're at it.

Jake
+1  A: 

There are no data structures, Grasshopper. Only pointers and the dream of meaning.

Peter Wone
A: 

In addition to K&R, the Cow Book (Practical C Programming; 3rd Edition by Steve Oualline) is also a very good C reference. I like having both books on hand.

Since it hasn't been mentioned yet: The C++ FAQ LITE is invaluable for C++ programming.

Eric P. Mangold
I don't think Steve Oualine is a very good author to suggest. His book on C++ is so bad, I rank him with Herb Schildt. All of his code snippets are either invalid C++ or *really* bad practices.
greyfade
+3  A: 

For an introduction to C++, I really liked Accelerated C++: Practical Programming by Example, by Andrew Koenig and Barbara E. Moo.

From the homepage:

This is a first-rate introductory book that takes a practical approach to solving problems using C++. It covers a much wider scope of C++ progamming than other introductory books I've seen, and in a surprisingly compact format.

If you're "looking for a quick and reliable way to learn enough C/C++ to be comfortable completing exercises with it", I'd say it's the perfect C++ book for you.

Sébastien RoccaSerra
A: 

I ran into the book Big C++ in the library and it was the best C++ book I have ever read. The author not only covers C++ but explained OO concepts in an easy to understand way.

My opinion is that you want to learn both. But it does depend on what type of software you want to write with the language. Business software would most definitely use OOP but system software like device drivers may not.

Vincent Ramdhanie
A: 

C++ FQA lite is worth reading when you think you feel comfortable with C++.

Alexandre C.