Read from cin or a file
- by m42a
When I try to compile the code
istream in;
if (argc==1)
in=cin;
else
{
ifstream ifn(argv[1]);
in=ifn;
}
gcc fails, complaining that operator= is private. Is there any way to set an istream to different values based on a condition?