tags:

views:

254

answers:

8

Possible Duplicate:
What is the best source to learn C++?

I have been coding in C for quite some time now (around 3 years). Now i wish to learn programming in C++ and code in object oriented methodology.

There has been some discussion on how to start learning C++ http://stackoverflow.com/questions/525726/the-best-place-to-start-learning-c

That points to some good resources, but what i am looking for exactly is how do a hard core sequential C programmer should move to object oriented programming in C++ ...Any good starting directions/any sample applications which you suggest would be very usefull. Thanks in advance...

+5  A: 

Read a C++ book. One of those mentioned in your link. There is no better way to learn a complex language like C++.

Amit Kumar
Sure there is! http://abstrusegoose.com/249
Greg Hewgill
Programming is simple! master a language is not easy, see Teach Yourself Programming in Ten Years, http://norvig.com/21-days.html
lsalamon
A: 

For a "hard core sequential C programmer", it might be worthwhile to learn how common implementations of objects and polymorphism and related concepts actually work in C++. As long as you're comfortable with function pointers and dynamic memory allocation, implementing most of the principal C++ features is reasonably straightforward in C.

A reasonable place to start might be the Virtual method table article on Wikipedia.

Once you have that foundation, then you can learn to use the concepts offered by C++ without having to think of the implementation as being some kind of black magic.

Greg Hewgill
A: 

Is your interest more a matter of learning C++ syntax or really getting into object oriented design? There are a lot of books appropriate for learning C++ syntax and OO coding... I really liked Lippman's "C++ Primer, 2nd edition" as a means to learn the C++ language. The 3rd edition added a bunch of stuff I didn't like, but it looks like they trimmed it back for the 4th edition.

I would really encourage you to get into unit testing though. I think thats were you find the most practical insights on OO design. Michael Feathers "Working Effectively with Legacy Code" does a good job of introducing testing techniques for C and C++ code, I would recommend looking at it. Then move onto any other testing book, I really liked www.xunitpatterns.com. I am currently reading "Growing Object-Oriented Software, Guided by Tests", and I like how it ties testing and OO design together. The book is also more accessible (translation:shorter) than www.xunitpatterns.com, but I think still prefer www.xunitpatterns.com for its completeness/objectivity.

Frank Schwieterman
I am aware of the syntax of C++. My main goal is to getting in to OO design and use C++ tool to achieve...Thanks for the book suggestion..
james
"I really liked Lipner's 'C++ Primer Plus, 3rd edition'": the man is called Lippman, and his book is called "C++ Primer". And the 4th edition is considerably better than the earlier ones
Alexandros Gezerlis
Also, the 4th edition of the "C++ Primer" is approximately 400 pages shorter than the 3rd one.
Alexandros Gezerlis
My apologies, I had the comments about c++ primer all wrong. Fixed.
Frank Schwieterman
A: 

I suggest you to read Design Patterns. It is a very helpful reading which can introduce you to the architecture problems you can find in an object oriented language.

Maurizio Reginelli
Design patterns are very useful, but I would say they belong to the "next level", which is good to look at when having mastered the basics
Anders Abel
A: 

I really liked 'Accelerated C++'. Recommended if you have prior programming experience.

http://acceleratedcpp.com/

rmk
C++ Primer (4th Ed) is better these days. Moo, one of the authors of AC++, helped making the fourth edition of C++ Primer so good.
Tronic
A: 

The site I found very useful and user-friendly for beginners is cplusplus.com's C++ tutorial:

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

Rollin_s
A: 

You can read as much as you want, if you don't try to get it 'in your fingers' then you won't get far.

Read a book, get a C++ compiler (e.g. on Windows you can use the free Visual C/C++ Express Edition), and start experimenting.

Don't just read. Read, test, experiment.

Patrick
+2  A: 

alt text courtesy of http://abstrusegoose.com/249

jdizzle