I have to write one new class with members something like
class A
{
static int i;
const int j;
char * str;
...
...
};
Now I want to write assignment operator for it.
A& A::operator=(const A& rhs)
{
if(this != rhs)
{
delete [] str;
str = new char[strlen(rhs.str)+1];
strcpy(str, rhs.str);
}
return * this;
}
Is it right? I shall ignore the static and const members(?).