c program run on codeblocks but not on clion how is it even possible?

i successfully run it on codeblocks, but my clion doesnt display anything when i run it.
i usually use clion, so im very furious about this. (dont want to be obligated to use codeblocks)
please help a poor lost soul.
this is the code.

dont have a lot more to say, but still stackoverflow wants me to write more, so here i am.

#include <stdio.h>
#include <stdlib.h>


int **malloc2dR(int r,int c);
void free2d(int **M, int r);
int **MATinit(int r, int c);
void MATstampa(int **m, int r, int c);
void change(int **M, int r, int c);

int main() {
int r=3,c=4;
int **M=MATinit(r,c);

MATstampa(M,r,c);
change(M,r,c);
MATstampa(M,r,c);

free2d(M,r);

return 0;
}

int **malloc2dR(int r, int c){
int **m;
int i;

m=malloc(r*sizeof (int *));
for(i=0;i<r;i++)
m[i]=malloc(c*sizeof (int));

return m;
}

void free2d(int **m, int r){
int i;

for(i=0;i<r;i++)
free(m[i]);
free(m);
}

int **MATinit(int r, int c){
int **M=malloc2dR(r,c);
int i,j;

printf("scrivere in input i valori della matrice %dx%d\n",r,c);

for(i=0;i<r;i++)
for(j=0;j<c;j++)
scanf("%d",&M[i][j]);

return M;
}

void MATstampa(int **m, int r, int c){
int i,j;

for(i=0;i<r;i++) {
for (j = 0; j < c; j++)
printf("%d ", m[i][j]);
printf("\n");
}

printf("\n");
}


void change(int **M, int r, int c) {
int i, j;
int ii, jj;
int **Mfake=malloc2dR(r,c);

for(i=0;i<r;i++)
for(j=0;j<c;j++)
Mfake[i][j]=M[i][j];

for (i = 0; i < r; i++)
for (j = 0; j < c; j++)
if (M[i][j] % 2 == 1) {

for (ii = 0; ii < r; ii++)
Mfake[ii][j] = 1;
for (jj = 0; jj < c; jj++)
Mfake[i][jj] = 1;

}

for(i=0;i<r;i++)
for(j=0;j<c;j++)
M[i][j]=Mfake[i][j];

free2d(Mfake,r);

}
0

请先登录再写评论。