i'm trying to implement little program that takes a text and breaks it into lines and sort them in alphabetical order but i encountered a little problem, so i have *readlines* function which updates an array of pointers called *lines*, the problem is when i try to printf the first pointer in *lines* as an array using **%s** nothing is printed and there is no errors.

I have used *strcpy* to copy an every single text line(local char array) into a pointer variable and then store that pointer in *lines* array but it gave me the error.

Here is the code:

```
#include <stdio.h>

#define MAXLINES 4
#define MAXLENGTH 1000

char *lines[MAXLINES];

void readlines() {
    int i;
    for (i = 0; i < MAXLINES; i++) {
        char c, line[MAXLENGTH]; 
        int j;

        for (j = 0; (c = getchar()) != '\0' && c != '\n' && j < MAXLENGTH; j++) {
            line[j] = c;
        }

        lines[i] = line;
    }
}

int main(void) {
    readlines();
    printf("%s", lines[0]);
    getchar();

    return 0;
}

```