How do I make a character array scanner properly? I start with this:

char delay_chars[10];


then I have a stream of incoming characters that I need to assign like this:

['I', ' ', 'l', 'o', 'v', 'e', ' ', 'p', 'i', 'e']


I can do that, but then more characters come in so I need it like this:

[' ', 'l', 'o', 'v', 'e', ' ', 'p', 'i', 'e', ' ']
['l', 'o', 'v', 'e', ' ', 'p', 'i', 'e', ' ', 'a']
['o', 'v', 'e', ' ', 'p', 'i', 'e', ' ', 'a', 'n']
['v', 'e', ' ', 'p', 'i', 'e', ' ', 'a', 'n', 'd']
['e', ' ', 'p', 'i', 'e', ' ', 'a', 'n', 'd', ' ']
[' ', 'p', 'i', 'e', ' ', 'a', 'n', 'd', ' ', 'c']
['p', 'i', 'e', ' ', 'a', 'n', 'd', ' ', 'c', 'a']
['i', 'e', ' ', 'a', 'n', 'd', ' ', 'c', 'a', 'k']
['e', ' ', 'a', 'n', 'd', ' ', 'c', 'a', 'k', 'e']


You get the idea. I don't know how I can remove the first character of a char array (like I do with a String, remove(0, 1)) and I don't know how to add a new element at the end.

If I had to guess, I'd make a loop that will reassign the index of each character one step back or something like that but I'm not sure if that's how I should do it.
If I had to guess, I'd make a loop that will reasign the index of each character one step back or something like that but I'm not sure if that's how I should do it.


Yep, that's pretty much it...

Here's how I do it:

char data[10];

if (Serial.available()) {
    char inch = Serial.read();
    for (int i = 0; i &lt; 9; i++) {
        data[i] = data[i+1];
    }
    data[9] = inch;
}


Every incoming character gets added to the end of the array after everything else has been shuffled down one place.