Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Playing with features of C++ to learn more on using them
- #include <fstream>
- #include <iostream>
- #include <string>
- using namespace std;
- void infoInput(istream& inF, string& inData);
- void infoOutput(ostream& outF, const string outData);
- int main()
- {
- string data;
- infoInput(cin, data);
- ofstream outFile;
- outFile.open("OstreamTest.txt", ios::app);
- infoOutput(outFile, data);
- infoOutput(cout, data);
- return 0;
- }
- void infoInput(istream& inF, string& inData)
- {
- getline(inF, inData);
- }
- void infoOutput(ostream& outF, const string outData)
- {
- outF << outData;
- }
- // Sample Output - Shows my dorkiness
- // Mortal Kombat is the reason I got into programming. Now I'm a programmer! YEAH!!!
Advertisement
Add Comment
Please, Sign In to add comment