Help!!!
I am getting this error. How do I fix it that the arraypointerstores the values. Error:Non-const lvalue reference to type’double’ cannot bind to a value of unrelated type ‘int’. H
//function for setter. This function returns a reference to theelement in the array indexed by the subscript
template <typename V, int CAP> //setter
V& MyStaticArray<V, CAP>::operator[ ]( int &index)//v,return type. Name of the class<datatype,size>
{
if (index < 0 || index >= arraySize)
IndexError();
arrayPointer[index];
return arrayPointer[index]; //Error:Non-const lvalue referenceto type ‘double’ cannot bind to a value of unrelated type ‘int’
}
Expert Answer
An answer will be send to you shortly. . . . .