How to copy element from one array to other element of array using pointers?

I am attempting to copy the elements of one dynamically-allocated array (addVec) into another (array) in memory, after passing a pointer to the array from main to a function (changeArray) that assigns values to addVec. My approach thus far: Dynamically allocate an array (array) in main Dynamically allocate another array (addVec) in changeArray() Pass the… Read More How to copy element from one array to other element of array using pointers?

When passing a 2d array as parameter with pointers to print its values it only prints zero

So, i have to make a function that takes a 2d array as parameter with a pointer, specifically, so that cant be changed. This function that i wrote works, but when i print it, it only prints zeros. When printing directly in main() it works normally. Thanks in advance! Code: void calcula_media(float (*matriz)[3]){ int i,… Read More When passing a 2d array as parameter with pointers to print its values it only prints zero