Let's say I declare an array by doing this:
int array[] = {1, 2, 3, 4};
By what I understand, you can also create the same array using pointers and malloc:
int* array = malloc(sizeof(int) * 4);
*(array) = 1;
*(array + 1) = 2;
*(array + 2) = 3;
*(array + 3) = 4;
What is the difference between the two ways? Is one necessarily better than the other?