To start with, you need to be more careful about capitalization. C++ is a case-sensitive language; MyList is not the same as MyLIST or myList . This alone could be the source of some of the errors.
Secondly, you don't want torename an object to something else; you want to copy the object to another object. Talking of 'renaming' is likely to confuse everyone, since you cannot do that.
Now, the reason that the MyList i = new MyList(); doesn't work is because the new operator returns a pointer to a newly allocated object, whereas declaring the List the way you have creates a local object of type MyList -not a pointer. if you declare it as
myList * list = new myList(); you'd be on the right track.
Note, however, that you need to delete the allocated memory when you're done with it:
MyList* MyList::mult (MyList a, MyList B)
{
int count;
for ( int i = b.size; i>0; i-- ) //in our case b.size=3 so it should create 3 new list
{
MyList* list = new MyList();
for(int j = b.size - 1; j>0; j-- )
{
for(int y = a.size - 1; y>0; y--)
{
list[count]= a[y]*b[j]; //multiplication not every case contemplated here
count++;//counter to fill the new array
}
}
}
return list;
}
This still isn't complete, however, as you need to be able to allocate a MyList with a given list size, which means that the MyList() constructor has to get a size and allocate the appropriately sized array, and the destructor has to free it.