Im a Java programmer, with a little C knowledge who wants to get started with with C++ can someone recommend a good tutorial?
also any help with:
Contact the NYC Department of Education718-935-2200 (Monday-Friday, 8 a.m.- 6 p.m.) 311 (24 hours a day, seven days a week) and let the operator know you have an education-related issue. TTY Services are available by calling 212-504-4115.
A closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). In other words, a closure gives you access to an outer function's scope from an inner function.
Closures are useful because they let you 'remember' data and then let you operate on that data through returned functions. This allows javascript to emulate private methods that are found in other programming languages. Private methods are useful for restricting access to code as well as managing your global namespace.
Depends on your target platform, I use Visual Studio as an IDE.
The general rule of C++ as opposed to Java is that it contains a hell of a lot more freedom than Java, especially as regards to templates vs generics, the stack vs the heap, and the enforcement (or lack thereof) of object orientation and it's principles. For example, C++ provides the encapsulation-breaking friend statement, the const_cast, allocates objects on the stack and pointers can point to them, templates have infinitely more power than generics, etc.
The other main thing you will have to get used to is resource management. C++ does not provide a GC. You will need to familiarize yourself with RAII (resource acquisition is initialization) and how scope-based construction and destruction work to avoid resource leaks.
You will also need to brush up on the Standard Template Library (STL). The STL has a much more directed approach than the Java libraries- for example, the std::iostream class provides native methods to extract floats, strings, etc from the file, whereas in Java you need both a File and a Scanner, although it's scope is far more limited- no GUI or directory-based components, just for starters.
Oh, by the way, seriously, ditch your C knowledge. It'll hurt rather than help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With