/* 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\\CISC1110\\pgms\\chapter8\\myinput.txt"); //un-comment to redirect cout to a file //ofstream cout("c:\\bc\\CISC1110\\pgms\\chapter8\\myoutput.txt"); while (getline(cin, line)) { change(line); cout << line << endl; } // system("pause"); //un-comment when using DevC++ return 0; } void change(string &str) { str += 's'; return; }