Is there a way to set an input file stream:
ifstream in;
so that it will read not from a file, but from stdin instead? What I am trying to do is make it so the input can come from either stdin or from a file. If there is no file specified it will be from stdin. If there is a file, it will read from the file, then at the end switch to reading from stdin. I would like to make it so that I can use ifstream and not FILE*. I can do it using the file pointers, but I already set up the WHOLE program using streams and I don't want to switch them to fscanf.
Thanks,
Skatanic
ifstream in;
so that it will read not from a file, but from stdin instead? What I am trying to do is make it so the input can come from either stdin or from a file. If there is no file specified it will be from stdin. If there is a file, it will read from the file, then at the end switch to reading from stdin. I would like to make it so that I can use ifstream and not FILE*. I can do it using the file pointers, but I already set up the WHOLE program using streams and I don't want to switch them to fscanf.
Thanks,
Skatanic