Need help beginning with C++

Started by
11 comments, last by azherdev 16 years, 10 months ago
I don't know why people see c++ as so difficult language.. I don't know a simple thing about any other languages then c or c++( well i know a bit of brainfuck but that doesn't count i think ;) ). If you want to make only some small games,just for fun i guess python will do, but if you want to work in the industry(and i got impression you want) you will have to learn c++ eventually.
But one advice you don't know how hard programming is, until you will spend 6 hours on debugging piece of code which simply refuses to work for unknown reasons;)
That's were battle for becoming a programmer starts: will you be patient and last till you fix it, or will you give up?
Until that very moment saying you can work hard is pointless;)

edit:
7 years it's a looong time, maybe you should consider learning D straight away? ;)
Advertisement
I learned fairly quickly from this book after trying and failing from numerous others. I suppose it depends on the style of writing you prefer (personally I can't abide those Dummies-style books where the author forces his humour on you).

I found learning C++ relatively painless, but I was already familiar with a lot of programming constructs from using Basic.

I learnt the basics of C++ in around 3 months. But learning a language is insignificant compared to what goes with it. The language itself is simply a tool to be used. The real meat of learning to programming is concerned with algorithms, design patterns, architecture etc. This is why most university courses (in the UK at least) don't teach you much programming - you're left to teach yourself.
When I was 14, I decided to learn to program games. Back then, 1992-1993, my options were pretty much C/C++.

After doing few "printf and scanf" exercises, I immediately started to try to make a game. Back then, no DX, no OpenGL for me. It was Mode13 using BIOS to do 320x200 256 color graphics. I found a lib (FastGraph) and away I went.

It is not impossible nor is it even daunting. One suggestion would be, make some very short term goals. Do not embark on making Super Mario Bros. clone. That is way too much. Also, do not do 3D at this time at all. 3D adds complexity that you should not even bother with.

1. Get Microsoft Visual C++ Express, DirectX SDK, and Windows Platform SDK

2. Get one of those "Program C++ in 24 hours" or "C++ for Dummies" books. That will get you started. Do the examples there and compile the code. These books are great if you know nothing. But are pretty much useless after 12 hours.

3. Get a nice reference book. Not a step by step, but something where you can look up std::list and find out how to use it. Personally I use C++ Primer Plus 5th Ed. Some like, some don't. It does the trick for me.

4. Get a good site on the web to find info. I use google... I type: "C++ std::list" and do research.

5. Get yourself HGE lib to handle 2D games. HGE is great cause it won't bog you down with DX crap.

And practice. It will be very frustrating. In C++, many times the bug is not where it seems. It is very important you understand what a pointer is, what a reference is, and how objects are created and destroyed. If you don't, you will have odd bugs you will not be able to find.

But it is very possible and not that difficult. It will just take commitment. C++ is a frustrating language even to the experts. The thing that is simply great about C++ is the support. From the forums, to books, to the billions lines of code that can pretty much take care of anything you need.

The foundation is important here. If you skip over memory management (pointers, heap vs sack, etc) you will be in big trouble very soon. Many other concepts, pretty much the same as in any other language.

This topic is closed to new replies.

Advertisement