CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: Paul McKenzie

Search: Search took 0.13 seconds.

  1. Re: Passing a sub-range of a vector by reference

    Also, there is really no need to write the loop yourself.


    int sub_vector_length = 2;
    vector<int> sub_vector(myvector.begin(), myvector.begin() + sub_vector_length);

    If the compiler's...
  2. Re: Passing a sub-range of a vector by reference

    Just pass a pointer to the first item in the vector you want to use in the function. A vector is a wrapper for a contiguous, dynamic array of T, so there is no need to be copying anything.

    ...
Results 1 to 2 of 2





Click Here to Expand Forum to Full Width

Featured