I just have a basic doubt..does the string s1,s2 statement call any default
constructor?or is it that it is not performed since parameterised
constructor is present?
On Wed, Sep 21, 2011 at 1:31 AM, vijay singh wrote:
> It is because of the presence of the single parameterised constructor in
> th
It is because of the presence of the single parameterised constructor in the
class definition.
So, if we are writing the following statement...
string s1;
s1="test";
It'll call the single parameterised constructor.
But this only true in the case of single value assignment as in the above
statemen
Consider a class
class string
{
char *p;
int len;
public:
string(char *a);
};
string::string(char *a)
{
length = strlen(a);
p= new char[length +1];
strcpy(p,a);
}
string s1,s2;
char *name ="test";
s2=name; // statement
Why does constructor gets called in state
the following is a function which computes the double tree of a given tree.
here is the description of a double tree.
doubleTree()
For each node in a binary search tree, create a new duplicate node, and
insert the duplicate as the left child of the
original node. The resulting tree should still be