Alright, still working on a class assignment (practically re-making the map class out of a vector).
What I'm trying to figure out is how to properly overload the [] operator in order to get this working how I need it.
What I want to be able to do is this: associativeArrayObject["Elephants"] = 5;
In the AssociativeArray class, I overload the [] operator like so: void AssociativeArray::operator[](string str) ...
However, that "void" is wrong. I need to return something in order to assign that something to "5". What am I returning? (Optimally the position in the 2D vector where I will be storing the data, but how?)
I have a feeling I'm overlooking something very simple.