// FILE: StringOp.cpp // ILLUSTRATES STRING OPERATIONS #include #include "apstring.h" int main () { // Local declarations apstring first_name, last_name; // inputs - first and last names apstring whole_name; // output - whole name apstring greeting = "Hello "; // output - a greeting string // Read first and last names. cout << "Enter your first name: "; cin >> first_name; cout << "Enter your last name: "; cin >> last_name; // Join names in whole name whole_name = first_name + " " + last_name; // Display results cout << greeting << whole_name << '!' << endl; cout << "You have " << (whole_name.length () - 1) << " letters in your name." << endl; // Display initials cout << "Your initials are " << (first_name.[0]) << (last_name.[0]) << endl; return 0; }