Guarda qui:

Codice PHP:
#include <stdio.h>
#include <stdlib.h>

riempi(int** matrice,int i,int j){ 

int x,y

    for(
0;x<=i-1;x++)
    {    
        for(
0;y<=j-1;y++)
        {       
            *(*(
matrice+x)+y) = x+y;
            
printf("%d ",*(*(matrice x)+y)); 
        } 
        
printf("\n"); 
    } 
}

int main()
{
    const 
int n 4;
    
int i;
    
    
int** mat = (int**)malloc(sizeof(int*));
    for(
0ni++)
        
mat[i] = (int*)malloc(sizeof(int));
        
    
riempi(matnn);    
        
    for(
0ni++)
        
free(mat[i]);
    
free(mat);    

nota la differenza (spero di non aver fatto errori sull'allocazione dinamica, sono un pò arrugginito col C).
Tra l'altro il compilatore non ti ha dato un warning tipo questo?

codice:
main.c: In function ‘main’:
main.c:22: warning: passing argument 1 of ‘riempi’ from incompatible pointer type
main.c:4: note: expected ‘int **’ but argument is of type ‘int (*)[4]’