/* Program to illustrate string processing using cin and cout */ #include #include #include using namespace std; //function prototypes void change(string &str); int main() { string line; //un-comment to redirect cin to a file ifstream cin("c:\\bc\\cis1_5\\newpgms\\chapter8\\myinput.txt"); //un-comment to redirect cout to a file // ofstream cout("c:\\bc\\cis1_5\\newpgms\\chapter8\\myoutput.txt"); while (getline(cin, line)) { change(line); cout << line << endl; } system("pause"); return 0; } void change(string &str) { str += 's'; return; }