Learning C++; Which books should i get.

Alright i want to learn C++ as it gives you the power i want to do whatever i want, and is so useful for learning other languages. The problem is, i do not know where to start. I am a decent Unity Script (Javascript) programed though im sure if any REAL programmer saw my code they would chew me out and delete it, but i can get most things down using it. I also do not understand C# all that well. So which book should i get to get me from where i am at to intermediate at least. And maybe from intermediate to beyond.

Also, i know i can learn this stuff online for free but i like to have the book in hand so i can mark it up and make notes in it, not to mention i just like to be able to read it when i am at school or on the bus. This is not to say you can’t point me in the direction of some really helpful sites or videos to learn it if you know of any.

Thanks to anyone who took the time to read all this, and double thanks to anyone who helps me out!

Beginning Game Programming C++ , im sure you can find it online.
ive peeked in this book but never got the chance to read it lol. enjoy!

C++ is a good language, and I like many things about it, but be careful. Many aspects of C++ were not incorporated into Java nor C# because C++ was designed for a different “programming age” and with different purporses, and the current version of C++, C++99, doesn´t have a lot of features that are standards today, like threads. I hope the next one, C++1x (it should have been released 2 years ago as C++0x, but the committee always reviews something that should have been decided) brings C++ to the 21 century of programming.

I suggest Bruce Eckel´s books, Thinking in C++, especially Volume 1. You can download a free html version of the book here http://www.mindviewinc.com/, but if you are serious about C++, buy the papper version. You´ll use it a lot.

I don’t know about specific good c++ fundamental for game programming book but try these one for general concept how to:
Accelerated C++ (Not much theory but straight to the claimed real world practice)
C++ Primer Plus
The C++ Programming Languages (Complete ‘Manual’ of the C++ itself by the C++ creator Bjarne Stroustrup)
Deitel C++ How to Program

For C++ tutorial you can try Nehe opengl beginner tutorial or gametutorials.com.

You should pick up a C# book while you’re at it.
It’s good to know the flexibilities/differences of languages like ASM,C,C++,C#.

As someone with way too much experience with c++, my opinion is that c++ is a bad language to write new code in. It’s simply not a good general purpose language anymore, and although technically it’s faster, it’s extremely unlikely that it’s speed benefit will be all that big of a deal. Most cpu time will generally be spent in APIs that you don’t develop, and getting best performance will be achieved through understanding these technologies and developing architecture that works well with them. In the end, c# is superior in terms of general productivity, code portability, and pretty much everything else that matters except for speed. In short, too much to sacrifice so that code taking <10% cpu time runs 2X faster.

I think you would be much better served learning a newer language like c#, I would put c++ development now in the same position ASM programming was 2 decades ago.

There are plenty of free beginners tutorials, just google. And “Thinking in C++” by Bruce Eckel, mentioned above, is a really good book, compared to lots of other “beginner books”. And if you’re new to programming in general, i’d suggest to spend the money on “general programming” books, or when you will know the basics of language, there are lots of books on specific topics (like game programming for example). You’ll have to buy books, don’t worry, but for language basics it’s not worth the bookshelf space.

C++ is a very good language to make you a good programmer.

It teaches a lot of computer science and gives a better understanding of things at a lower level.

That being said, do not think for a second it’s like “javascript” or C#, C++ is not easy like them, it’s tricky, difficult to get your head around and won’t be easy or fun to learn.

A lot of people who try to learn C++ fail, so make sure your’re sure about doing it.

It’s C++ power that makes it so difficult, you don’t have easy short cut functions like C# is full of, you want some functionality, you write it.

C++ isn’t hard - I think it’s harder to start with C# or even java, because of the necessity to understand at least some OOP concepts. In C++ you can write code the old procedural way (C-like), while getting used to OOP concepts. At least for me, coming from Pascal, it was very important thing. But if you’re new to coding at all, it doesn’t matter-you can learn one C-language, and move to another, as syntax and concepts are very similar.

Oh, and I wouldn’t say C++ is harder than C#, just depends on application you are developing.

Well, what makes a good programmer is highly subjective, but I do think this might not be as true as you think. Perhaps I underestimate how much my c++ experience helps me, but if I thought about learning it now, I just can’t imagine how the benefits would outweigh the time spent. Much of what happens under the hood with high level language compiling, asynchronous processing, and the nuances of whatever other APIs your using means that much of what you learn about the performance of c++ programs won’t as readily apply to c# or another newer, high level language.

I’d still suggest c# first, IMO if you start with c++ you’ll end up developing alot of functionality you’ll realize was a waste of time when looking into c#. I’d say there’s about as much positive programming practices you’d learn about c# from c++ as you’d learn about c++ from c. The newer languages are generally fixing the mistakes of the past, and adapting to what programmers mostly want/need moving into the future, and so far I’d call c# a big success in that respect.

Agreed. I think what’s interesting is that the general idea is that c++ is harder, even though it’s technically less complicated. The reason it’s harder in practice is because the code people write with it is more complex and harder to deal with because the language doesn’t handle what they want to do well, and allows for some dangerous practices that just naturally happen because they’re allowed. In short, can likely be argued that C++ code is more complicated because the C++ language is more basic.

Pointers, Memory access problems, dealing with memory and garbage collection at runtime.

The C# harder than C++ is the single stupidest statement I’ve ever heard.

Partials and generics, delegates, interfaces, etc.

Of course, C# is easy when you know C++ or other C-language. And most of the listed above are also available in C++, as well as pointers and managed/unmanaged memory access is available in C#(Pointer (computer programming) - Wikipedia).

What’s difficult about any of that? none of that’s remotely difficult especially verses memory management in C++.

from your link “In the C# programming language, pointers are supported only under certain conditions”.

C++ is one of the hardest programming languages still used commonly.

C# is one of the easiest.

C++ How to Program by H.M. Deitel Publishing

What is so complex about pointers? If you had said, header files or operator overloading etc then you may have a point but pointers common.

Pointers and memory management is not really that complex. It has just becoming obsolete in a multicore world. The fact is I can think of plenty of things that are not easy to do in c# but at least the language is evolving in a useful way. C++ feels like it is stuck together with bits of wire and glue.

PS: I used one of the Deitel books

Hehe, not only can you not judge smart/stupid, but you haven’t heard people say much, if that tops your list. There is nothing complex about pointers or allocating/deallocating memory, what’s hard is the headaches they allow developers to create in real-life, large applications, which is my point. Heck, with standard type libs you really don’t have to deal with much of that anyways, if you don’t want/need to in C++. You are confusing the complexity of the language with the complexity of what people generally produce with it in practice, they are two very different things.

What makes large programs is not C# or C++ or even VB.Net (managed vs unmanaged vs Mix), code size has no bearing with regards to which language to use, it all ends up at byte code level at some point, no, what matters in a program is how much video crap, audio crap and graphical crap gets shoved into it. Ever look at what makes things really FAT??? Open c:\windows and get the properties on the Microsoft.NET folder, that is all library files that C# and VB.Net use, C++ has no use for them not unless you use managed code. So the crutch is that “managed” library code to use during the ILASM processing (ok not all of it is libraries, some is other junk like binary tools, configs, etc), the framework is evil, very evil and has made people lazy (including me), C++ is a fun language, easy to use, but very potent. Understand templates though, they will be your friend. Just do not over use them or they become your enemy.

That is not true in a practical sense, C# has some things that are done the way their done because of experiences with large code bases. For instance, the lack of macro support, while it’s technically a reduction in potential power, it makes it far less ‘natural’ for developers to create confusing code. Larger code bases have more minds/opinions influencing their structure and readability, and if the language makes it easier for developers to make confusing code (which macros clearly do), then the language is less suitable as a result. I believe that C++ does make it too easy to produce code that’s less manageable, and the developers of C# recognized that and it positively influenced C#'s design.

When working on my own code, I miss macros in c#. When working with other people’s code, I most certainly do not miss macros, they abstract and hide behavior in such a way that is often more dangerous than it’s worth. Overall, I think it was a smart move and worth the tradeoff.