1.
a) To read anything from a file stream, you need to open it.
Give one example in C++ code of opening a file stream.
b) How do you know whether the stream has failed in C++?
c) In your own words, what is a stream manipulator in C++?
a)
ifstream in; // declaring a variable to read data from file
in.open("filename"); // open file using open function
b)
there are two ways to check if a file is properly opened or not.
is_open, fail functions
is_open function gives a value of true if file is successfully opened
file function gives a value of true, if opened a file was failed
c)
<< is insertion stream manipulator
and >> is extraction stream manipulator
<< is used to write data to stream
and >> is used to read data from a stream
1. a) To read anything from a file stream, you need to open it. Give one...