#include <iostream>
using namespace std;
class VectorND
{
public:
int N;
VectorND(int n)
:N(n) {}
float *vec_value = new float[N];
void assignValue(int i, float v)
{
vec_value[i] = v;
}
};
This is my code and I'm trying to solve this problem, but I do not know what to do.
Problem 4. Implement operator overloading of VectorND class for the following operations.
my_vec.assignValue(3) = 10; std::cout << my_vec(3);
Example
int main(void) { VectorND my_vec(10); my_vec.assignValue(3) = 10; std::cout << my_vec(3); return 0; } Output : 10