User input into an array HELP

Problem description:
I want the user to be able to type in (in the serial monitor) for example 0, 1, 2, 3, 4, 5, 6 and hit enter.
I then want Arduino to create an array of the number of elements entered into the serial monitor. I then want to be able to print that array as such, "array = [ 0, 1, 2, 3, 4, 5, 6 ]

Any example code will be appreciated.

You could find some inspiration here: Projects/Command-array-of-values.ino at master · tttapa/Projects · GitHub

Arrays are a fixed size in C, so you need to decide before hand what the largest the array will be allowed to get.

Have a look at the examples in Serial Input Basics - simple reliable ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.

...R