I am trying to get access a specific variable of a 2D vector in another class using "get" function. However, it is vague for me how to ask the code to select the exact cell.
I have:
vector<vector<double>> slopeGrid; // slope of each grid cell
in a class and column/row address in a different class:
I am thinking about:
double getSlopeGrid (vector<vector<double>> &slopeGrid)
{SlopeGrid = this->slopeGrid;)
but not sure if this way I can get access the exact variable in the 2D vector.
Thank you very much for your reply. There are 2 issues:
1- My 2D vector located in a different class and I want to write a get function for accessing this PRIVATE variable.
2- Moreover, I need to get access to an exact cell of that 2D vector, for example slopeGrid[2][3]
I have the x and y of the vector as separate double variables and want to ask the code to read in the value of the vector in that address like: