If I pass a vector by reference to a function:
void QuadraticInterpolateArray(vector<double> &b) {
double step = 12.2;
for (int j = 0; j < b.size(); j++) {
b[j] = step;
}
}
I don't need later to deference b
when I need to access to its value by using operator []. Instead, if I pass vector by pointer:
void QuadraticInterpolateArray(vector<double> *b)
I need (*b)[j] later.
In both case I'm passing the "address" of that vector. Why with reference it works and with pointer doesn't? Its just by design?