Also following this topic: What does "dereferencing" a pointer mean?
assert(p[1] == 'b');
the operator [] should automatically deference the pointer, let me direct "change" the value to the pointed data.
But if I do somethings like this:
void QuadraticInterpolateArray(vector<double> *b) {
// ...
double step = 12.2;
for (int j = 0; j < (*b).size(); j++) {
b[j] = step;
}
// ...
}
I can't use b[j] = step;
i.e. I'm trying to set 12.2 at each index of the vector.
Where am I wrong? What's different?