January 18, 201313 yr Just curious on how you guys learned C++, and just in general any tips. I'd ideally not want to purchase anything like a book, but if you've found that it's a great resource worth my money then I'll consider it. The only other programming language I really know is Java, so i'm fine with OOP. I also understand PHP if it makes a difference Thanks!- tips EDIT: Sorry that this doesn't really flow, I have the flu and aren't thinking straight :D
January 18, 201313 yr The only way to learn a programming language is to start using it. For c++ in particular this book comes highly recommended: http://www.amazon.com/dp/0201700735/?tag=stackoverfl08-20 "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti
January 19, 201313 yr Author The only way to learn a programming language is to start using it. For c++ in particular this book comes highly recommended: http://www.amazon.co...tackoverfl08-20I meant more like a website to learn the basics/what it can do
January 19, 201313 yr If you have some programs written in Java, try rewriting them in C++. It'll help you gain a feel for the language, without really having to worry about the logic. Definitely recommend the book that obfuscator posted. This is a good reference too, I guess: http://www.cplusplus.com/doc/tutorial/introduction/
January 19, 201313 yr Author If you have some programs written in Java, try rewriting them in C++. It'll help you gain a feel for the language, without really having to worry about the logic. Definitely recommend the book that obfuscator posted. This is a good reference too, I guess: http://www.cplusplus...l/introduction/That sounds like a good idea, thanks.I'll check out the website and book!
January 19, 201313 yr Author If you have some programs written in Java, try rewriting them in C++. It'll help you gain a feel for the language, without really having to worry about the logic. Definitely recommend the book that obfuscator posted. This is a good reference too, I guess: http://www.cplusplus...l/introduction/I seem to get lost right around in here: http://www.cplusplus.com/doc/tutorial/pointers/
January 19, 201313 yr Their guide to pointers isn't very good. Honestly, I didn't understand them at all until they came up in class recently. Just know that their main use is for returning arrays. Google how to return arrays in C++ and you'll probably have a better understanding of them.
January 19, 201313 yr This may be helpful if you're having difficulty with pointers. "It's not a rest for me, it's a rest for the weights." - Dom Mazzetti
January 19, 201313 yr Author The only thing I don't get is why you would want to use the pointer. LIke what advantage is there to passing a pointer instead of just the variable itself?Either way, I'll google that and read that link
January 19, 201313 yr The only thing I don't get is why you would want to use the pointer. LIke what advantage is there to passing a pointer instead of just the variable itself?Either way, I'll google that and read that link Pointers can be abstracted as references. When you pass a class in Java as a parameter, it passes it by reference; that is, it does not create a copy of the class. Instead, it passes the address of the data to the method. The same goes for storing it. The difference between this C++ code: class A { public: int foo; }; void ChangeFoo(A* a) { a->foo = 1; } and this Java code: class A { public int foo; } static void changeFoo(A a) { a.foo = 1; } is nonexistent. Java internally passes classes as pointers.
Create an account or sign in to comment