KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I would like to be able to convert between std::vector and its underlying C array int* without explicitly copying the data. Does std::vector provide access to the underlying C array? I am looking for something like this vector<int> v (4,100) int* pv = v.c_array(); EDIT: Also, is it possible to do the converse, i.e. how would I initialize an std::vector from a C array without copying? int pv[4] = { 4, 4, 4, 4}; vector<int> v (pv);
Tags (comma-separated)
Save Edits
Cancel