Language: C

#include <stdio.h>
#include <math.h>
 
int check(int* a, int* b, int an, int bn,
          int q, int r, int i, int* d){
  do{
    if(a[q]<b[r]){
      check(&a, &b, an, bn, q+1, r, i, &d);
    }else if(a[q]==b[r]){
      d[i] = a[q];
      i++;
      check(&a, &b, an, bn, q, r, i, &d);
    }else{
      check(&a, &b, an, bn, q, r+1, i, &d);
    }
  }while(q>an || r>bn);
 
  return i;
}
 
int main(void){
  int n, m, i, j, p;
  scanf("%d %d", &n, &m);
  int k[n];
  for(i=0; i<n; i++){
   scanf("%d", &k[i]);
   p = k[i];
   int a[i][p];
   for(j=0; j<p; j++){
   	scanf("%d", &a[i][j]);
   }
  }
  
  int c[n][m];
  int p = check(&a[0], &a[1], 
                  k[0], k[1], 0, 0, 0, &c[0]);
  for(i=1; i<n-1; i++){
    p = check(&c, &a[i+1],
                   p, k[i+1], 0, 0, 0, &c[i]);
  }
 
  printf("%d", p);
  return 0;
}

Compiler output:
main.c: In function 'check':
main.c:8:13: error: passing argument 1 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
    8 |       check(&a, &b, an, bn, q+1, r, i, &d);
      |             ^~
      |             |
      |             int **
main.c:4:16: note: expected 'int *' but argument is of type 'int **'
    4 | int check(int* a, int* b, int an, int bn,
      |           ~~~~~^
main.c:8:17: error: passing argument 2 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
    8 |       check(&a, &b, an, bn, q+1, r, i, &d);
      |                 ^~
      |                 |
      |                 int **
main.c:4:24: note: expected 'int *' but argument is of type 'int **'
    4 | int check(int* a, int* b, int an, int bn,
      |                   ~~~~~^
main.c:8:40: error: passing argument 8 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
    8 |       check(&a, &b, an, bn, q+1, r, i, &d);
      |                                        ^~
      |                                        |
      |                                        int **
main.c:5:37: note: expected 'int *' but argument is of type 'int **'
    5 |           int q, int r, int i, int* d){
      |                                ~~~~~^
main.c:12:13: error: passing argument 1 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   12 |       check(&a, &b, an, bn, q, r, i, &d);
      |             ^~
      |             |
      |             int **
main.c:4:16: note: expected 'int *' but argument is of type 'int **'
    4 | int check(int* a, int* b, int an, int bn,
      |           ~~~~~^
main.c:12:17: error: passing argument 2 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   12 |       check(&a, &b, an, bn, q, r, i, &d);
      |                 ^~
      |                 |
      |                 int **
main.c:4:24: note: expected 'int *' but argument is of type 'int **'
    4 | int check(int* a, int* b, int an, int bn,
      |                   ~~~~~^
main.c:12:38: error: passing argument 8 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   12 |       check(&a, &b, an, bn, q, r, i, &d);
      |                                      ^~
      |                                      |
      |                                      int **
main.c:5:37: note: expected 'int *' but argument is of type 'int **'
    5 |           int q, int r, int i, int* d){
      |                                ~~~~~^
main.c:14:13: error: passing argument 1 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   14 |       check(&a, &b, an, bn, q, r+1, i, &d);
      |             ^~
      |             |
      |             int **
main.c:4:16: note: expected 'int *' but argument is of type 'int **'
    4 | int check(int* a, int* b, int an, int bn,
      |           ~~~~~^
main.c:14:17: error: passing argument 2 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   14 |       check(&a, &b, an, bn, q, r+1, i, &d);
      |                 ^~
      |                 |
      |                 int **
main.c:4:24: note: expected 'int *' but argument is of type 'int **'
    4 | int check(int* a, int* b, int an, int bn,
      |                   ~~~~~^
main.c:14:40: error: passing argument 8 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   14 |       check(&a, &b, an, bn, q, r+1, i, &d);
      |                                        ^~
      |                                        |
      |                                        int **
main.c:5:37: note: expected 'int *' but argument is of type 'int **'
    5 |           int q, int r, int i, int* d){
      |                                ~~~~~^
main.c: In function 'main':
main.c:35:7: error: redeclaration of 'p' with no linkage
   35 |   int p = check(&a[0], &a[1],
      |       ^
main.c:22:19: note: previous declaration of 'p' with type 'int'
   22 |   int n, m, i, j, p;
      |                   ^
main.c:35:18: error: 'a' undeclared (first use in this function)
   35 |   int p = check(&a[0], &a[1],
      |                  ^
main.c:35:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:36:40: error: passing argument 8 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   36 |                   k[0], k[1], 0, 0, 0, &c[0]);
      |                                        ^~~~~
      |                                        |
      |                                        int (*)[m]
main.c:5:37: note: expected 'int *' but argument is of type 'int (*)[m]'
    5 |           int q, int r, int i, int* d){
      |                                ~~~~~^
main.c:38:15: error: passing argument 1 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   38 |     p = check(&c, &a[i+1],
      |               ^~
      |               |
      |               int (*)[n][m]
main.c:4:16: note: expected 'int *' but argument is of type 'int (*)[n][m]'
    4 | int check(int* a, int* b, int an, int bn,
      |           ~~~~~^
main.c:39:40: error: passing argument 8 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   39 |                    p, k[i+1], 0, 0, 0, &c[i]);
      |                                        ^~~~~
      |                                        |
      |                                        int (*)[m]
main.c:5:37: note: expected 'int *' but argument is of type 'int (*)[m]'
    5 |           int q, int r, int i, int* d){
      |                                ~~~~~^