I wrote the post that this was closed for saying it was a duplicate question. It is not a duplicate question. While I really appreciate the time and effort responders have made their answers often don't explain what's going on. Please vote to reopen.
consider the following:
typedef struct node
{
int number;
struct node *left;
struct node *right;
} node;
node *test1 = malloc(511 * sizeof(node));
node (*test2)[1] = malloc(511 * sizeof(node));
test1 is a pointer but we can reference test1[510], and test2 is a pointer to an array that contains 1 element but we can reference test2[510][0]
so in the first case I'm basically creating a 1 dimensional array and in the second a two dimensional array.
am I correct and is it correct to think of malloc in both of these cases is implicitly defining the number of elements?