getchar() does not recognize horizontal tabs in my input
<p>Wrote the C console application below to save input to a string.  </p>

<pre><code>#include &lt;stdio.h&gt;
#define MAXLINE 200

int main () {
    int c, x;
    char in[MAXLINE];

    for (x = 0;(c = getchar()) != EOF; ++x){
        in[x] = c;
    }
    return = 0;
}
</code></pre>

<p>I will be manipulating this string and printing a modified version as output, but before I get to that, I’ve run into a problem— whenever I step through the code with GDB and a watch window, it completely ignores horizontal tabs.  I even tried writing a workaround:</p>

<pre><code>#include &lt;stdio.h&gt;
#define MAXLINE 200

int main () {
    int c, x;
    char in[MAXLINE];

    for (x = 0;(c = getchar()) != EOF; ++x){
        if (c == 9)
            in[x] = '\t';
        else
            in[x] = c;
    }
    return = 0;
}
</code></pre>

<p>But this performs in exactly the same way as the first example.  How can I get my code to recognize tabs in my input, and to save them to an array element as such?</p>

<p>EDIT:  Here is my actual code.  It compiles with no errors for me on CodeBlocks, and I've never had a problem with CodeBlock s swallowing nonprint characters before.</p>

<pre><code>#include &lt;stdio.h&gt;
#define MAXLINE 100

int main () {
    int c, q, x, y, z, tabcount;
    char in[MAXLINE];
    char out[MAXLINE];

    for (x = 0;(c = getchar()) != EOF; ++x){
        in[x] = c;
    }

    q = x;
    for (x = y = 0; x &lt;= q; ++x) {
        tabcount = 0;
        if (in[x] == '\t') {
            ++tabcount;
            if (tabcount &lt;= 4) {
                for (z = 0; z &lt;= 4; ++z) {
                    out[y] = ' ';
                    ++y;
                }
            }
            else
                out[y] = '\n';
        }
        else
            out[y] = in[x];
        ++y;
    }
    in[x] = '\0';

    printf ("%s", out);

    return 0;
}
</code></pre>