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
Get step-by-step solutions from verified subject matter experts
