Creating C++ objects
- by Phenom
I noticed that there are two ways to create C++ objects:
BTree *btree = new BTree;
and
BTree btree;
From what I can tell, the only difference is in how class objects are accessed (. vs. - operator), and when the first way is used, private integers get initialized to 0.
Which way is better, and what's the difference?
How do you know when to use one or the other?