Another significant difference is that when using malloc, memory is allocated on heap, when using local variables those are in stack but heap is bigger.
This feature is called “Variable-length array” and is supported in C99 C standard.
array size is fixed, once memory is allocated you are not allowed to change its size in the same context. where as in malloc() you can change size, by realloc().
increment of array base cannot be changed, where it can be changed in malloc().
local array are allocated in stack, global array are allocated in data segment. where as malloc() are allocated in heap segment.
malloc function is mainly used to allocate memory on run-time whereas array declaration with fixed size is used when you know the size of array during compile time.