Question: identify and correct errors in the following class declaration: class nifty [ //data charpersonality[]; int talents; //methods nifty (); nifty (char * s); ostream &

identify and correct errors in the following class declaration:

class nifty

[

//data

charpersonality[];

int talents;

//methods

nifty ();

nifty (char * s);

ostream & operator<<(ostream & os, nifty & n);

}

nifty:nifty()

{

personality = NULL:

talents = 0;

}

nifty:nifty (char * s)

{

personality = new char [strlen(s)]:

personality = s;

talents = 0;

}

ostream & nifty:operator<<(ostream & os, nifty & n)

{

os << n;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!