here's the problem.
i was given a test case v[0]=1.
in order to implement operator[],i need to get the access the value it is refering to which is 1.
i tried to write some code ignoring the = by assuming the compiler knows that = means assigning 1 to that position 0.and it turn out to be wrong.
so is it right if i'm assuming = as overload operator?
wouldn't it makes the test case to be
but is that right?and how am i suppose to write the signature?
thanks in advance.
i was given a test case v[0]=1.
in order to implement operator[],i need to get the access the value it is refering to which is 1.
i tried to write some code ignoring the = by assuming the compiler knows that = means assigning 1 to that position 0.and it turn out to be wrong.
so is it right if i'm assuming = as overload operator?
wouldn't it makes the test case to be
Code:
v.operator[](index).operator=(value);
thanks in advance.
Comment