Moving onto c++ from c

Started by
3 comments, last by Aliii 11 years ago
Hello, i have learned c for maybe three months and made some games and apps with the language and i am looking onto learning c++. I have read c++ tutorials in the past and they seem very similar to c to begin with, as i have a book on it. What i wish to know is what should i start with regard to c++ bearing in mind i know the basics of c and have a bit of experience with it.

Thanks
Advertisement

I would look at this piecemeal in stages. Simple concepts such as knowing when to use pointers instead of references, replacing lists and arrays with STL variations when it makes sense etc. I would move on to simple concepts of putting functions into structures and getting used to the idea of the implied "this" pointer existing. From there, you can start into classes and virtual functions and all that fun stuff. Basically, I am suggesting you take it slow and only incorporate small replacement bits as you go which clean up your C code using C++ abilities but don't jump in head first till you have built on your basic understanding.

Get a good book on C++. You know some C, which means you will be able to progress pretty quickly through it, but then again you've only been doing C for 3 months... which is really not much at all.

I have to say that even though people often cite C++ as just "C with classes" the fact is that C++ pretty much redefines most of the coding style, libraries and idioms that pure C coders "grew up with." I would definitely think about investing in a good C++ book or a lot of research.

You probably will pick the language up a lot easier given that you have a C background but there are quite a few differences to learn, OOP by itself could cover many books(and does!)

http://www.learncpp.com/

...I think this is the best to start with.

Once you went through the tutorials find yourself a project that is relatively small(1-2 weeks) and start working on it in C++. ...or rewrite one of your older games in C++.

I dont recommend a book if you already know the basics. Especially not something like Stroustrup`s book.

C is a subset of C++ so (almost)all the C-stuff will work.

This topic is closed to new replies.

Advertisement