I'm... guessing you meant constructor. AFAIK there are no "constructs" in C++. There are data structures, constructors, and a member function of the allocator class called "construct", but no "constructs", per-se.
A constructor is a function that is automatically called when an object is created ("constructed"). Constructors have the same name as the type of the object being constructed, and it may take arguments if written to do so.
#include "arbitrary_header_that_declares_the_type_Objects"
class House {
public:
House() { //A default constructor.
wall_count = 4;
features = NULL;
}
House (int walls) { //A non-default constructor.
wall_count = walls;
features = NULL;
}
~House() { //A destructor.
if (features != NULL)
delete features;
}
private:
int wall_count;
Objects* features;
//Our house has no roof! ;_;
};
int main() {
House basic; //The default constructor is called.
House octagonal(8); //The non-default constructor we defined earlier is called.
return 0; //Both houses are automatically destroyed.
}