copy data in arrays

I have following function to copy data in arrays.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

 unsigned int msa[8];
 unsigned int msh[4];

template <std::size_t size, std::size_t size_s >

void cpy_data_aes(std::array<unsigned int, size>& source_location, std::array<unsigned int, size_s>& dest_location, int no_mem_locations, int source_locations)                  //! copy data
     {
        int i;
        for(i=0;i<no_mem_locations; i++)
        {
           dest_location[i] = source_location[source_locations+i];

        }
     }
 cpy_data_aes(msa, msh, 4, 4);


Error:no matching function for call to ‘cpy_data_aes(unsigned int [8], unsigned int [4], int, int)’
cpy_data_aes(msa, msh, 4, 4);
You have defined cpy_data_aes to take std::arrays as argument but you are passing raw arrays. There is no implicit conversion from raw arrays to std::array so doesn't work.
Topic archived. No new replies allowed.