For the assignment that you're working on, you do not want to be declaring variables named str1, str2, etc. You want your TenStrings class to have a single data member (call it strings) which is an array of ten char pointers. This array would be initialized in your constructor.
You have spent so much time asking questions here, so much of which cover the same basic material. You would almost certainly be better off taking a break from StackOverflow, and using that freed-up time to study some of those tutorials that I've just linked to (or any others that you may have at your disposal.)
EDIT (responding to your comment): Here's an example. It won't solve your homework problem, but it should give you some hints. Good luck. (By the way, I haven't compiled this, but I think it compiles.)
class SimpleExample {
public:
SimpleExample();
SimpleExample& operator += (const SimpleExample&);
friend ostream& operator cout(ostream&, const SimpleExample&);
private:
int myData[5];
}
SimpleExample::SimpleExample()
{
// Initialize a new SimpleExample instance. (Note that myData[i] is
// the exact same thing as this->myData[i] or (*this).myData[i] . )
for (int i = 0; i < 5; i++) {
myData[i] = i;
}
SimpleExample& operator += (const SimpleExample& that)
{
for (int i = 0; i < 5; i++) {
myData[i] += that.myData[i];
}
return *this;
}
ostream& operator << (ostream& os, const SimpleExample& simp)
{
for (int i = 0; i < 5; i++) {
os << that.myData[i] << " ";
}
return os;
}