Question: Help!!! I am getting this error. How do I fix it that the arraypointer stores the values. Error:Non-const lvalue reference to type 'double' cannot bind

Help!!!

I am getting this error. How do I fix it that the arraypointer stores 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 the element in the array indexed by the subscript

template //setter

V& MyStaticArray::operator[ ]( int &index) //v,return type. Name of the class

{

if (index < 0 || index >= arraySize)

IndexError();

arrayPointer[index];

return arrayPointer[index]; //Error:Non-const lvalue reference to type 'double' cannot bind to a value of unrelated type 'int'

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!