2D Vector Error-C++
I am new to vector programming in C++. I want to initialize 2D matrix of
unknown size so i came to vector side. I have two files 1) .h and 2).cpp.
In .h file i initialized the vector like this
vector<vector<double> > vector_stor;
Then in .cpp after getting the size of each dimension from another source
i re-sized the vector like this
size_X=5; //assumption
size_Y=5; //assumption
vector_stor.resize(size_X);
for(int i=0;i<size_X;i++)
vector_stor[i].resize(size_Y);
Now i want to store a data from a .mat file, initially read by matIO
library, using Mat_VarRead function like this
Mat_VarReadData(vector_stor); //there are other arguments also but for
demo just assume it
Mat_VarReadData take arguements in void* data and i have 2D vector. When i
am doing like this its giving error
Error 1 error C2664: 'Mat_VarReadData' : cannot convert parameter from
'std::vector<_Ty>' to 'void *'
Can anyone please guide me that how i can do this? It will be very helpful
for me.
Thanks
No comments:
Post a Comment