I have an issue passing a matrix 2D to a vector(1D array)with function in C. There is the code of what i want to create:
#include #define N
This is how you do it in 17 times less lines:
#define N 8 int mat2d[N][N] = { /* stuff */ }; int vec1d[N * N]; memcpy(vec1d, mat2d, sizeof vec1d);