A special type of subroutine called at the creation of an object.
23
votes
5answers
6k views
Database connection in constructor and destructor
I am playing with different ways to do database interaction in PHP, and one of the ideas I have been playing with is connecting to the DB in the constructor and disconnecting in the destructor. This ...
1
vote
3answers
185 views
Review of three constructors for a String class
I have the following declaration in my String.h file:
private:
char* nstring;
int nlength;
};
The following are three constructors I've implemented in ...