>>47はキャストが無かったので、一応完全版

#define JSIZE 128
#define KSIZE 40

main () {
  int (*xxx)[JSIZE][KSIZE];
  int (*xx)[JSIZE * KSIZE];
  int t;
  int xxx_size;
  //
  t = 3;
  // xxx
  xxx_size = sizeof (int) * t * JSIZE * KSIZE;
  xxx = (int (*)[JSIZE][KSIZE]) malloc (xxx_size);
  // xx
  xx = (int (*)[JSIZE * KSIZE]) xxx; // 内容を一致させるのであれば、ポインタの置き換えで終わり
  //
  free (xxx);
}