S
sandwich_eater
my compiler does not like
ifstream fin1;
ifstream fin1();
istream fin1;
What is the correct way to declare a stream variable e.g. at the top of
a program, in this case I want to use an input file but I don't mind
the variable being a generic stream, or generic
input stream if that is neccessary. All the examples
I've seen in the books I have use something like...
ifstream fin(somefile);
OK, but I want to name the file after the declaration.
I also saw "istream& in" as a parameter to a function which kind of
interests me. BTW I want to read a character at a time.
Thanks.
ifstream fin1;
ifstream fin1();
istream fin1;
What is the correct way to declare a stream variable e.g. at the top of
a program, in this case I want to use an input file but I don't mind
the variable being a generic stream, or generic
input stream if that is neccessary. All the examples
I've seen in the books I have use something like...
ifstream fin(somefile);
OK, but I want to name the file after the declaration.
I also saw "istream& in" as a parameter to a function which kind of
interests me. BTW I want to read a character at a time.
Thanks.