Problem with array and function(s)

jonman5:
But I do want it to create an empty array and simply append to the array at the nth index starting from n=0.

the size of arrays cannot be changed in C++.

either 1) define the length of the array with the maximum elements you wish to add, or 2) look into some dynamic objects like vector.

** dynamic allocation on a micro controller is problematic, so start with (1).

gfvalvo:
No can do. Unless you use dynamic memory allocation (an advanced technique), you must declare the array size at compile time.

Well, this compiler will allow you to create an array on the stack, e.g.:

void myFunction(size_t arrySize) {
  char myString[arrySize] = "";
}