I am by no means a master of the C language, nor am i going to claim to be. But I was pretty sure I understood pointers until I came across these two very different implementations that the author claimed would have the same outcome. Im just not seeing it. Can somebody please explain to me what each of these are doing?
int (*AA)[4];
AA = malloc(sizeof(int[4])*size);
and the 2nd one:
int *BB;
BB = (int *)malloc(size*sizeof(int));
From my current understanding, If i wanted to make the 2nd one in c++, it is equivalent to:
int *CC;
CC=new int[size]
Is this assumption Correct?