C Indexing Error With Dynamically Allocated Array Stack Overflow

C Indexing Error With Dynamically Allocated Array Stack Overflow