vector<vector<double>> v2d(2, vector<double>(3,0.0));
How later on reset all elements back to 0.0?.
How to clear vec entirely, free memory?.
Are there any performance degradation in using vector arrays verus conventionl arrays using new or malloc?..
What can be done to minize such degradation if any?.
johans22
0
Newbie Poster
Recommended Answers
Jump to PostHow later on reset all elements back to 0.0?
There are a number of ways. One that comes to mind is:
v2d.assign(2, vector<double>(3));
This will completely replace the contents of the vectors with default initialized objects. However, that can be troublesome if you have …
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.