This feature
bool check(int i) { if (i % 2 != 0) return true; }
has an undefined behavior, since it returns nothing when the number i is even.
In addition, it is written in your assignment that you need to replace all the lines with even numbers, whereas in this cycle
for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { if (check(i) ==true) { mas[i][j] = fill(mas, mas1, i, j); } } }
there is an attempt to replace all the odd rows of a two-dimensional array.
In addition, there is no point in trying to pass a two-dimensional array to this function.
int fill(int**mas, int*mas1, int i, int j) { mas[i][j] = mas1[i]; return mas[i][j]; }
First, the types of argument and parameter are not compatible if the argument is really a two-dimensional array, and not a one-dimensional array of pointers to the first elements of one-dimensional arrays. And, secondly, it is enough to pass one term of a two-dimensional array to a function in order to fill it, and not the entire two-dimensional array. And, thirdly, in the body of the function you are only trying to assign one element, and not the entire line. It doesn't make much sense.
Based on the above, the relevant functions can be defined as follows:
bool is_even( int i ) { return i % 2 == 0; }
The fill function may look like this.
void fill( int *mas, const int *mas1, int n ) { for ( int i = 0; i < n; i++ ) mas[i] = mas1[i]; }
Then the program cycle will be
for (int i = 0; i < n; i++) { if ( is_even( i ) ) fill( mas[i], mas1, n ); }
It would be possible not to write the is_even function, since it is known that even indices are 0, 2, etc.
Therefore one could simply write
for (int i = 0; i < n; i +=2) { fill( mas[i], mas1, n ); }
Instead of the own function fill you can use the standard algorithm std::copy , declared in the header <algorithm>
Then everything would look very simple. Turn on the header
#include <algorithm> //...
and write a loop
for (int i = 0; i < n; i +=2) { std::copy( mas1, mas1 + n, mas[i] ); }