I am writing a program that accepts input from a user, and places the input into a dynamic array. The variable counter is used to keep track of the number of elements that have been added to the array and is returned by the following function so that it can be used to iterate through the array. This code will allow me to input one value and on the second value I receive an access viloation error. After doing some debugging I am getting that the value of counter is equal to -33686019 (or garbage) consistently. Am I properly incrementing the variable? I'm sure I'm doing something small but it is my first experience with the use of pointers.