So i've been working on a program in c++ that uses classes, and i am having a few problems with returning a class value from another class's function.
So i have a class called X, which is essentially a class that defines a linked list, and has some of the basic operations. In that class i have a '[]' operator that is overloaded with each value in the linked list. The operator can also override values in the linked list using
the function for that is
I also have another class called Y which calls upon class X for it's operator function
Class Y is also a linked list
the problem is for
i'm not sure how to go about getting the function to return X*
from the class Y
Thanks,
Phoenix1990
So i have a class called X, which is essentially a class that defines a linked list, and has some of the basic operations. In that class i have a '[]' operator that is overloaded with each value in the linked list. The operator can also override values in the linked list using
Code:
*classxvariable[i] = "string";
Code:
std::string* X::operator[](long index)
Code:
X* Y::operator[](long index)
the problem is for
Code:
X* Y::operator[](long index){}
from the class Y
Thanks,
Phoenix1990
Comment