tags:

views:

988

answers:

11

I'm trying to find a least-resistance path from C# to C++, and while I feel I handle C# pretty well after two solid years, I'm still not sure I've gotten the "groove" of C++, despite numerous attempts.

Are there any particular books or websites that might be suitable for this transition?

+4  A: 

I suggest you to read The C++ Programming Language book (written by Bjarne Stroustrup). It may not be the best book to begin with, but it is definitely on you should read, sooner or later.

Mladen Jankovic
Dammit, you were just ahead of me. Oh well…
Leon Timmermans
Yeah, that can be some what frustrating :)
Mladen Jankovic
+7  A: 

I recommend The C++ Programming language by Bjarne Stroustrup. It's not a suitable book for new programmers, but I found it quite effective as programmer who was experiences in other languages and didn't want to waste too much time with learning how while loops work. It's a dense but quite comprehensive book.

Leon Timmermans
That sounds like an excellent reason to choose that book. Just what I needed. Thanks!
Teetow
+5  A: 

Anything written by Meyers, recommended by same, or written by Sutter.

Adam Mitz
A: 

I'd consider K&R a prerequisite for C++. Perhaps the best thing about C++ is that it's a better C.

And of course, Stroustrup (as suggested by Mladen Jankovic) is a must read.

Jon Ericson
A: 

My two standard books are "Object-Oriented Programming in C++", Third Edition, by Robert LaFore, published by The Waite Group, and "C++ from the Ground Up" by Herbert Shildt, published by Osborne McGraw-Hill.

Stephen MacDougall
+1  A: 

They are fundamentally very different beasts so there is no least resistance path between. However I recommend you to read http://www.phpcompiler.org/doc/virtualinheritance.html beforehand in case you ever need a non-trivial inheritance. It can save you a few headaches.

artificialidiot
+2  A: 

Accelerated C++ by Koenig (Edit: and Moo.)

Max Lybbert
don't forget Moo ;).
Daniel James
A: 

The C++ Programming Language by Bjarne Stroustrup is a must read. Effective C++ (Scott Meyers) is another book I found helpful.

And to balance all this, read the C++ FQA ( http://yosefk.com/c++fqa/ ) - while not a book, it's a valuable resource, and I wish I had access to it when I was getting started with C++. Just don't let it discourage you.

Ori Pessach
+1  A: 

I found Lippman et al's "C++ Primer: 4th edition" to be excellent. It emphasizes STL usage, best practices, and auto_ptr usage from the very first. I went from a Java position to a C++ assignment, and it was really excellent.

As a pure reference, Josuttis's "The C++ Standard Library" was STL at its best (and worst...the guy really doesn't pull punches)

Lastly, Meyer's Effective C++, as others have said is a must-read for the "gotchas" inherent in C++

+6  A: 

About two years ago, I made the switch from C# to C++ (after 10 years of writing java). The most useful book for me was Bruce Eckel's Thinking in C++ [AMZN]. You can also read the book online at Eckel's website. It's a well-written book--the kind you can read in bed--that's also useful as a keyboard-side reference. It assumes a significant level of comfort with OO and general programming concepts.

Stroustrup [AMZN] is invaluable as a reference, but basically impenetrable unless you're trying to answer a very specific question--and even then, it's a struggle. I haven't cracked my K&R [AMZN] in a few years. I don't think it's got much value as a C++ reference. Myers' Effective C++ [AMZN] (and, once you get there, Effective STL [AMZN]) are fantastic books. They're very specific, though (e.g., "36. Design functor classes for pass-by-value"), and hence not as useful as Eckel for making the transition.

My experience writing C++ after many years writing managed languages has been great. C++ is a hundred times more expressive than C#, and extremely satisfying to write--where it's warranted. On the other hand, on the rare occasions when I still get to write C#, I'm always amazed by how quickly and succinctly I can get things done.

Anyway, Eckel's Effective C++ can help you make the transition. There's a second volume that's good, but not as good. Stick with the original.

Good luck!

4: http://www.amazon.com/Programming-Language-Prentice-Hall-Software/dp/0131103628/ref=pd_bbs_1?ie=UTF8&s=books&qid=1221539310&sr=1-1 AMZN

cero
I think you mean the book "Thinking in C++" by Bruce Eckel, which is where the corresponding link leads to.
mooware
+1  A: 

This is a list of books that are recommended by the folks over in #C++ EFNet: http://rafb.net/efnet_cpp/books/