ive created a vector of vector and initialized like this
vector<vector<double>*>* vec1= new vector<vector<double>*>;
for(size_t t =0 ;t<500 ;t++ )
vector<double>* v = new vector<double>;
now can i assign like this ??
vector<vector<double>*>* vec2 = vec2 ;
in my program it worked fine and when i rebuild im getting error ->
Error 33 error C2440: 'initializing' : cannot convert from 'std::vector<_Ty>' to 'std::vector<_Ty> '
now ive used pointer everywhere in my project and i dont want to modify that one but wanted to assign it some other
i want to assign this -> vector<vector<double>*>* vec1 to vector<vector<double>> is it possible ???
Oh I didn't even notice because your original code had pointers. Anyways why would you want to do that? Doesn't really make sense to me. The only way I can think of though is to iterate with something like:
but in my project all vector pointers are used i dont know y
cant we use simple vectors for that
can u tell me diff between vector<vector<double>*>* and vector<vector<double>> in terms of memory and etc
One of them is a pointer to a container of containers full of pointers and the other is a container full of containers of objects. I would really only use pointers if the data types are large and not built-in types like doubles/ints/chars ect..
I think you should read up on pointers and STL containers before using them.