C++ Read/write file on Unix
<p>I know this is a very specific question. I am compiling a c++ code using g++ compiler on a unix machine.
I have the following one line code to read a text file specified as parameter in C++: test.cc</p>

<pre><code>int main(int argc, char *argv[])
{

    ifstream inputfile(argv[1]);

}
</code></pre>

<p>Now after compiling with g++, I will call it as:</p>

<pre><code>./test file.txt
</code></pre>

<p>But what should I do, if I want to call it as </p>

<pre><code>./test &lt;file.txt
</code></pre>

<p>In short how do I do a file read using default input/output</p>
