Advertisement
Guest User

Untitled

a guest
Jul 1st, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. //example 1, do sth to all elements in vector using c-style API
  2. void doSomething(const int *pInts, size_t numlnts);
  3.  
  4. vector<int> v;
  5. if (!v.empty()) {
  6. doSomething(&v[0], v.size());
  7. }
  8.  
  9. //example 2, init vector with c-style API
  10. size_t fillArray(double *pArray, size_t arraySize);
  11.  
  12. vector<double> vd(maxNumDoubles);
  13. vd.resize(fillArray(&vd[0], vd.size()));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement