Running a C app in Netbeans with an argument
<p>I'm trying to pass an argument to a C app (code below) using the "Run Command" in Netbeans.  Shouldn't this work?</p>

<pre><code>"${OUTPUT_PATH}" &lt; input.txt
</code></pre>

<p>Where the input text is just "I like bacon".  If I do this in a terminal window (
"./in &lt; input.txt" where "in" is what has been compiled ), it works as expected.</p>

<p>I want to be able debug the app I'm going to write but I need to be able to pass in a text file.  I thought I could use "Run Command" as I have when I used a file as an argument.  I want to pass in the text file as standard input, though, this time around.</p>

<p>Code...</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;


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

    char c = getchar();

    while( c != EOF ) { 
        putchar(c);
        c = getchar();
    }

    return 0;

}
</code></pre>

<p><strong>UPDATE</strong> - I switched to freopen and fgetc for now but would like to know if I can use redirect in Netbeans.  I have tried searching for a solution but so far the posts I've seen are rather old - hoping someone has a current work around if there is one. Otherwise, I'll work with freopen till I'm done with the app and then switch to standard input handling</p>