Dear Enoizat,
Thank you for your reply. Since I posted in the car via my phone, I made some grammar mistakes. I edited the code.
for your comments:
e) Since I have my writer function in class B, I need to make a copy of the "examVector" 2D vector to pass the copied vector to the function.
f) I am not sure about this line, I have 13 2D similar vectors and I am looking for the best way to do this. Maybe the following code is not the correct way:
|
copyVector = a->getVector();
|
But I am looking for a way to make a copy of the vector.
g) I think the declaring vector's size is not the problem. I tried it but also got an error!
for the last part of your comment, As I said earlier, I need to make a copy of a 2D vector in a different class, plain and simple! Since would like to copy whole the vector after all of the calculations and just for writing the results, I will use this "getVector()" function for one time.
BTW, I tried following way too but got an error as well!
vector<vector<double>> getVector(int i, int j) { return examVector[i][j]; }
Here is the error message, maybe it helps to better guide me:
no suitable constructor exists to convert from "double" to "std::vector<double, std::allocator<double>>, std::allocator<std::vector<double, std::allocator<double>>>> " |
Thanks