Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New to C++, help me get started [closed]

Tags:

c++

ide

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:

  • projects to learn with
  • recommended reading
  • what IDE ? I currently use NetBeans
  • general C++ advice
like image 745
Gwilym Avatar asked Aug 17 '10 15:08

Gwilym


People also ask

How do I contact the NYC DOE?

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.

What is a closure and how why would you use one?

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.

Why are closures useful?

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.


1 Answers

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.

like image 58
Puppy Avatar answered Oct 07 '22 04:10

Puppy