Sorry to have ask what I thought would be such a simple question, but Im trying to shift the contents of 5 ‘slot’ array such that I move the contents of 1 into 0, 2 into 1, 3 into 2, 4 into 3 and then overwrite 4 with a new value read from a RTC.

Things cycle, but after refilling the array the array seems to contain all the same time values (the latest one). I just cant see where I’ve gone wrong…

Thanks, this is driving me nuts as I just cant see what I’ve done wrong.

TIA

Here’s my code:

```
char* Top_Open_Times[5]={"00:00","00:00","00:00","00:00","00:00"}; //define the array of times
//every minute this section runs:
//move each array slot one up a slot save the current time into the 5th Array slot, slot 4.
for(int i = 0; i < 4; i++) //count up from 0 to 3 (4 array slots, 0-3)
{
Top_Open_Times[i] = Top_Open_Times[i + 1]; //Move the array contents one slot to the left.
//move 1 into 0, 2 into 1, 3 into 2, 4 into 3
}
readTime(rtc_time);//get the current time
Top_Open_Times[4] = rtc_time; //save this in slot [4]
for(int i = 0; i < 5; i++) //count up from 0 to 4 (5 array slots, 0-4)
{
Serial.println (Top_Open_Times[i]);
}
```