istream is a
class that represents and input stream. You can read values (ints, strings, your own classes) from these input streams.
cin is a specific istream
object that represents standard input to a program. Standard input (stdin in C) is frequently console input, but it can also be piped input from programs running in batch mode or other streams, depending on the context in which the program is running.
Other frequently-used istream
subclasses include ifstream (for reading from a file) and istringstream (for reading from a string in memory).
Your example doesn't make sense because istream is not an object, you are trying to use the insertion operator rather than an extraction operator on an istream, and myfile is undefined.
If you are trying to read from a file, you would use something like this:
1 2 3 4 5 6 7 8 9
|
#include <fstream>
using std::ifstream
int main()
{
ifstream fileStream("myFile");
int a;
fileStream >> a;
}
|
This will read an integer from the file "myfile".