This all makes sense to me, but I don't know if there is a way to manipulate the size of an array inside a function, let alone know how to implement this.
What do you mean when you say "manipulate the size of an array" ?
Are you trying to change the size of an array that already exists or declare a new one, possibly with the same name ? How are the array that you are trying to manipulate and arraySize declared ? Note that if you declare an array in a function then its scope will be limited to that function.
Please post an example of your code that causes the error ?