#408 C++: command line arguments go into input stream

general
closed-invalid
nobody
None
6
2012-06-30
2012-06-08
Matthias Rustler
No

Compiling this source

#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
int c;
while ((c = getchar()) != EOF && c != '\n')
{
cout << char(c);
}
cout << endl;
}

and running it with some command line arguments will print the command line arguments, e.g.
contst abcde
will print
abcde

(tested with both linux i386 v1 and v0)

Discussion

  • Closed because problem has nothing to do with C++.

     
    • status: open --> closed-invalid