Hi all.

Okay so first some explanation of the program.

1. When user input some text and press enter, the program saves the array and the newline. The chars entered should be less than 10 including the newline.

2. The input is saved into a storage that contains a maximum of 1000 chars.

3. The program print the storage. The storage should look like this

Code:
array1
array2
array3
array4
and so on..
Here's what I got so far
Code:
#include <stdio.h>

int main()
{
    
    char buffer[10];
    char storage[1000];
    int index = 0;
    int holder;
    int i = 0;

    holder = getchar();
    while (holder != EOF)
    {
        buffer[index] = holder;
        index++;
        
        if (holder == '\n')
        {
            for (i = 0; i < 1000; i++)
            {
                storage[i] = buffer[i];
            }
        }
    }
    
    storage[i] = '\0';
    
    printf("%s", storage);
}
The program stops working after i input some text.

Any idea?