// // test replaceElementAt() member function. // // assumes constructors work. // // assumes lstring is implemented using a Seq as the first/only // member variable. // #include #include // has EXIT_SUCCESS #include "lstring.h" #include "testsub.h" // has functions for testing void replaceOne(lstring & s, const lstring::length_pos p, const char c) { s.replaceElementAt(p, c); cout << "after replacing character " << p << " with " << c; printWithMsg(": ", s); } int main(void) { lstring wxyz("wxyz"); printWithMsg("original string: ", wxyz); replaceOne(wxyz, 1, 'b'); replaceOne(wxyz, 2, 'c'); replaceOne(wxyz, 0, 'a'); replaceOne(wxyz, 3, 'd'); cout << "That's all, folks!\n"; return EXIT_SUCCESS; }