Quote Originally Posted by transgalactic2
so in this code.
i use scanf or gets?
Neither. This loop does what you want:
Code:
    for (i = 0; i < 39 && (ch = getchar()) != '\n' && ch != EOF; ++i)
    {
        input[i] = ch;
    }
    input[i] = '\0';