I would like to scroll a text continuously in the screen. For example, 

```
text = "Hello, how are you"

```

The output should be:

```

Hello, how are you Hello, how are you
Hello, how are you Hello, how are you

```

and rotating from right to left.

So far I have compiled this:

```c
#include <curses.h>
#include <unistd.h> // For sleep()
#include <string.h> // For strlen()

int main(int argc, char *argv[]) {

    char *text = argv[1];
    char *text = "Hello, how are you";
    int text_length;
    int i, max_x, max_y;

    // Get text length
    text_length = strlen(text);

    // Initialize screen for ncurses
    initscr();
    // Don't show cursor
    curs_set(0);
    // Get terminal dimensions
    //   getmaxyx(stdscr, max_y, max_x);
    // Clear the screen
    clear();

    // Scroll text back across the screen

    while (1) {
        getmaxyx(stdscr, max_y, max_x);

        if ((max_x - text_length) <= 1)
            i = max_x;
        else
            i = (max_x - text_length);

        for (i; i > 0; i--) {
            clear();

            mvaddstr(0, i, text);
            refresh();
            usleep(20000);
        }
    }
    // Wait for a keypress before quitting
    getch();

    endwin();

    return 0;
}

Can anybody help to change the code and do that?

```