pythontutor-dev / pythontutor

10 stars 4 forks source link

mixed pointer/array declared types don't seem to work #12

Open pgbovine opened 5 years ago

pgbovine commented 5 years ago

(NB: is this just because i'm using C11 and not a newer dialect?)

examples:

int main(void) {
  char (*arr)[8]=malloc(3*8);
  arr[2][5]=75;
  return 0;
}
---
int main(void) {
  char (*arr)[3][8] = malloc(24*8);
  for (int i=0;i<3;i++){
    for (int a=0;i<8;a++){
      strcpy(arr[i][a],"CST8323");
    }
  }
  return 0;
}
---
int main() {
  int (*data)[3] = malloc(4 * 3 * sizeof(int));
  return 0;
}
---
int main() {
  int (*a)[4];
  a = malloc(sizeof(int)*4);
  return 0;
}