I have written following program for you. Just try to understand it. In the following program I have use ofstream class to take input from the user and to show that input on screen. In the following code I also have use outFile method to store output in file. I also have use one destructor method to clear memory space.
Code:
class mstream
{
public:
ofstream cosss;
mstream(void);
~mstream(void);
};
template <class Ts>
mstream& operator<< (mstream& sts, Ts val)
{
sts.coss << vasl;
cout << vals;
return sts;
};
sout << k << 0.1 << " Come to this world ";
sout << endl;
Bookmarks