Q: How to Copy array of vectors, using = raises error Expression:transposed pointer range I need to copy array of vector passed as reference to constructor/function.
member variable gets the reference to the passed array of vector
while running below code I am getting error Expression: Transposed pointer range
#define MAX 1001
Constructor( std::vector< int > (&Adj)[MAX])
{
    (this->Adj[MAX]) = Adj[MAX];
}


A: If you really want an array of fixed (compile-time) size of std::vector, use std::array
#include <array>
#include <vector>

Constructor (const std::array<std::vector<int>, MAX>& rhs)
{
   this->Adj = rhs;
}

and declare Adj as
std::array<std::vector<int>, MAX> Adj


A: You can use std::copy to copy an array:
#include <cstddef>    // size_t
#include <vector>     // std::vector<>
#include <algorithm>  // std::copy();

constexpr size_t max{ 3 };

struct foo {
    std::vector<int> Adj[max];

    foo(std::vector<int> (&values)[max])
    {
        std::copy(std::begin(values), std::end(values), std::begin(Adj));
    }
};

int main()
{
    std::vector<int> values[max];
    foo f{ values };
}

