Language: C

#include <stdio.h>
#include <math.h>
 
int check(int* a, int* b, int an, int bn, int q, int r){
  int i=0;
  do{
    if(a[q]<b[r]){
      check(&a, &b, an, bn, q+1, r);
    }else if(a[q]==b[r]){
      c[i] = a[q];
      i++;
      check(&a, &b, an, bn, q, r);
    }else{
      check(&a, &b, an, bn, q, r+1);
    }
  }while(q>an || r>bn);
 
  return c;
}
 
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]);
   }
   for( ;j<m; j++){
     a[i][j] = 0;
   }
  }
 
  int* c= check(&a[0], &a[1], 
                  k[0], k[1], 0, 0);
  for(i=1; i<n-1; i++){
    int cn = sizeof(c)/sizeof(c[0]);
    int* c = check(&c, &a[i+1], cn, k[i+1], 0, 0);
  }
  
  int cn = sizeof(c)/sizeof(c[0]);
  printf("%d", cn);
  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);
      |             ^~
      |             |
      |             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, int q, int r){
      |           ~~~~~^
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);
      |                 ^~
      |                 |
      |                 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, int q, int r){
      |                   ~~~~~^
main.c:10:7: error: 'c' undeclared (first use in this function)
   10 |       c[i] = a[q];
      |       ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
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);
      |             ^~
      |             |
      |             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, int q, int r){
      |           ~~~~~^
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);
      |                 ^~
      |                 |
      |                 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, int q, int r){
      |                   ~~~~~^
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);
      |             ^~
      |             |
      |             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, int q, int r){
      |           ~~~~~^
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);
      |                 ^~
      |                 |
      |                 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, int q, int r){
      |                   ~~~~~^
main.c: In function 'main':
main.c:37:18: error: 'a' undeclared (first use in this function)
   37 |   int* c= check(&a[0], &a[1],
      |                  ^
main.c:41:20: error: passing argument 1 of 'check' from incompatible pointer type [-Wincompatible-pointer-types]
   41 |     int* c = check(&c, &a[i+1], cn, k[i+1], 0, 0);
      |                    ^~
      |                    |
      |                    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, int q, int r){
      |           ~~~~~^