Assigning pointers to arrays in C++
c++
Solution
Arrays are non-assignable and non-copyable, so you'd have to copy each element by hand (in a loop), or using `std::copy`.
Problem
I want to do something like this below: ``` int main() { int a[10]; int *d = generateArrayOfSize(10) // This generates an array of size 10 on the heap a = d; print(a); // Prints the first 10 elements of array. } ``` However above code gives compilation error (incompatible types in assignment of ‘int*’ to ‘int [10]’). What can I do to make the above code to work?