Easy (I hope) Visual C++ question- Why NEW?
Posted on 2000-02-22
Ok- hopefully, this is an easy question. I'm trying to learn Visual C++ 6.0 from books (Couldn't find a local course on it that wasn't full) and I've got a few questions. For now, though, here's one-
Why use the NEW command when initializing variables and classes? For example, why say "new int a;" instead of "int a;"?
I've consulted 3 books, and so far the only difference that they tell me is that I've got to use the delete command after I'm done with them or else I get a memory leak. This seems more like a disadvantage than anything else, so what advantages does the NEW command provide?