Program of Dynamic Constructor

/*Program of Dynamic Constructor*/

#include
#include
#include
class abc
{
char *string;
int length;
public:
abc()
{
length=0;
string=new char[length+1];
strcpy(string,” “);
}
abc(char *s)
{
length=strlen(s);
string=new char[length+1];
strcpy(string,s);
}
void display()
{
cout<OUTPUT:
DON DON2

ga('create', 'UA-52099617-1', 'auto'); ga('send', 'pageview');







Leave a Reply

Your email address will not be published. Required fields are marked *