<p>At my university most of my classes have been in Java.  I have also recently learned C# (and the Visual Studio environment) at a summer internship.  Now I'm taking an Intro to Computer Graphics class and the grad student teaching the class prefers us to use C++ to access the OpenGL bindings via GLUT.</p>

<p>Does anyone have any good resources on how to make a good transition from Java/C# to C++?  Obviously pointers are going to be a big issue, but any other things I should be looking out for?  Any tutorials, guides, etc. would be very helpful!</p>

<p>Thanks!</p>

[{'answer_id': 19351, 'author': 'Kyle Cronin', 'author_id': 658, 'author_profile': 'https://Stackoverflow.com/users/658', 'pm_score': 2, 'selected': False, 'text': '<p>If you already know Java/C# I\'d recommend going directly to C instead of C++. According to the website, GLUT has the same bindings for C as C++ so you should be all set. Anyways, the best way to learn C is to purchase and read a copy of "The C Programming Language" and sit down with your C compiler and get your stuff to run.</p>\n'}, {'answer_id': 19356, 'author': 'ftdysa', 'author_id': 2016, 'author_profile': 'https://Stackoverflow.com/users/2016', 'pm_score': 2, 'selected': False, 'text': '<p>Effective C++ by Scott Meyers is a great book to help you learn C++.  Gives you an overview of the language and introduces a lot of key concepts that you will use throughout the development of basically any C++ program.</p>\n'}, {'answer_id': 19372, 'author': 'David McGraw', 'author_id': 568, 'author_profile': 'https://Stackoverflow.com/users/568', 'pm_score': 4, 'selected': True, 'text': '<p>Yeah, I got bit by the same bug.  The university tended to lean on Java, and then allowed you to choose the language you wanted to work with during projects.</p>\n\n<p>The best way is to just jump in. Start small, take baby steps, and just Google things that confuse you when you get there. Also find projects that have released their source code. See how they structure their programs. Basically, just tinker with concepts.  There is plenty of information around the web.</p>\n\n<p>Make it fun and grab a <a href="https://rads.stackoverflow.com/amzn/click/com/1598633600" rel="noreferrer" rel="nofollow noreferrer">C++ game development book</a> so it doesn\'t become mind numbing too quickly. </p>\n\n<p>Here\'s some places that I found useful while learning</p>\n\n<p><a href="http://www.cprogramming.com/" rel="noreferrer">http://www.cprogramming.com/</a></p>\n\n<p><a href="http://www.wikipedia.com" rel="noreferrer">http://www.wikipedia.com</a></p>\n\n<p><a href="http://www.cplusplus.com/" rel="noreferrer">http://www.cplusplus.com/</a></p>\n'}, {'answer_id': 19384, 'author': 'Dan Blair', 'author_id': 1327, 'author_profile': 'https://Stackoverflow.com/users/1327', 'pm_score': 2, 'selected': False, 'text': "<blockquote>\n  <p>Effective C++ by Scott Meyers is a great book to help you learn C++. Gives you an overview of the language and introduces a lot of key concepts that you will use throughout the development of basically any C++ program.</p>\n</blockquote>\n\n<p>I love this book in all 3 editions, and it was one of the books in a class I had as a Senior at UT, but it's just not a starting book.  You can become comfortable in C++ with a lot less, though you certainly won't be one with the compiler until you have read Meyer's work.  </p>\n\n<p>I don't know if it's still in print but I found <strong>Navigating C++</strong> usefull, but I was also very comfortable with pointers from Pascal.  Err of course I am forgetting that 15 years ago you had to learn what OOP was, now it's a little more assumed.  So perhaps Meyer's is not out of line.  Thoughts? </p>\n"}, {'answer_id': 19399, 'author': 'Mark Cidade', 'author_id': 1659, 'author_profile': 'https://Stackoverflow.com/users/1659', 'pm_score': 2, 'selected': False, 'text': '<p>Wikipedia has an article on <a href="http://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B" rel="nofollow noreferrer">comparisons between Java and C++</a>.</p>\n\n<p>You don\'t have to worry about checked exceptions in C++, but you do need to know about <a href="http://en.wikipedia.org/wiki/Const_correctness" rel="nofollow noreferrer">const correctness</a>.</p>\n'}, {'answer_id': 19439, 'author': 'postfuturist', 'author_id': 1892, 'author_profile': 'https://Stackoverflow.com/users/1892', 'pm_score': 2, 'selected': False, 'text': "<p>There are two main differences: the syntax, and memory management.</p>\n\n<p>In C++ you have pointers, which are more powerful (or less powerful depending on your interpretation of power) object references, which you already know about from Java.</p>\n\n<p>In Java you might do this:</p>\n\n<pre><code>Thing mything = new Thing(); // mything is an object reference\nmything.method();\n</code></pre>\n\n<p>In C++ you would do this:</p>\n\n<pre><code>Thing * mything = new Thing(); // mything is an object pointer\nmything-&gt;method();\ndelete mything;\n</code></pre>\n\n<p>The syntactical difference is obvious: '->' instead of '.' when calling an object method from a pointer to an object. In C++, you have to free the memory explicitly when you are done with an object. At the end of the day you are doing the same thing in C++ and Java, instantiating objects and calling methods, putting useless semicolons at the end of every line, etc. Is it any wonder that Python is becoming so popular?:</p>\n\n<pre><code>mything = Thing() # mything is whatever I want it to be\nmything.method()\n</code></pre>\n\n<p>Skimming through any half decent C++ text will help you fill in the rest of the details.</p>\n"}, {'answer_id': 19522, 'author': 'Cheekysoft', 'author_id': 1820, 'author_profile': 'https://Stackoverflow.com/users/1820', 'pm_score': 2, 'selected': False, 'text': '<p>I also thoroughly recommend Bruce Eckel\'s <a href="http://mindview.net/Books/TICPP/ThinkingInCPP2e.html" rel="nofollow noreferrer">Thinking in C++</a>. A fantastic book for already experienced programmers that want to get into the C++ mindset. </p>\n\n<p>He is kind enough to make electronic versions of his books <a href="http://mindview.net/Books/DownloadSites/" rel="nofollow noreferrer">available for free</a>.</p>\n'}, {'answer_id': 20733, 'author': 'Kristopher Johnson', 'author_id': 1175, 'author_profile': 'https://Stackoverflow.com/users/1175', 'pm_score': 2, 'selected': False, 'text': '<p>I strongly recommend that anyone learning C++ reads Stroustrups "The C++ Programming Language."  Meyers and Eckel have great stuff, but nothing beats learning from the guy who decided what the language should be and how he intended for it to be used.</p>\n'}, {'answer_id': 21153, 'author': 'adeel825', 'author_id': 324, 'author_profile': 'https://Stackoverflow.com/users/324', 'pm_score': 2, 'selected': False, 'text': '<p>I had the exact same issue.  The only book I was able to find was <a href="https://rads.stackoverflow.com/amzn/click/com/1590596080" rel="nofollow noreferrer" rel="nofollow noreferrer">"Pro Visual C++ 2005 for C# Developers" by Dean C. Wills</a>.  It\'s a good read with excellent examples, and I think the angle from which the book comes is probably what you\'re looking for.</p>\n'}, {'answer_id': 9797533, 'author': 'Franz Kafka', 'author_id': 643742, 'author_profile': 'https://Stackoverflow.com/users/643742', 'pm_score': 1, 'selected': False, 'text': "<p>You will need a completely differnt feeling for memory handling. Also think about freeing everything you don't need anymore. In Java and C# you just let go of your objects and the memory gets tidy up for you - you can't do that in CPP</p>\n"}]
['https://Stackoverflow.com/questions/19347', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/396/']