==== [Non-pointer version] ====
as a rule, for non pointer, as long as I have an object that dont'
need to pass to another function / call another function. I can do the
following (non-pointer) -
Database db;
db.open("user", "pass");
==== [Pointer version] ====
If I need to pass the object to another function then I should use
(pointer) -
Database* db = new Database();
bool flag = openConnection ( db, "user", "pass" );
==== [pointer version (reference)] ====
If I need to pass the object to another function then I can also use
(reference) -
Database db;
bool flag = openConnection ( db, "user", "pass" );
by doing method #1 and #3, i can avoid pointer most of the time?
then I will not need to worry about delete / free pointer after using
it.