Are the following two methods of creating arrays in C equivalent?
int main( void )
{
int *array = malloc(sizeof(int) * 10);
int array2[10];
}
My thought is that method two is syntactic sugar for method one, but I'm not sure.
Also, what do array and array2 contain after these declarations? I know array is a pointer to the start of an array, but what is the array initialized to? How about for array2?