Unformatted text preview: initials, which are single characters, you must concatenate those single characters with an existing string. Since string objects, by default, are the empty string, you can concatenate with it. Consider the following example: string output; // output string to be built from letters char first = 'A'; // first letter of output char second = 'B'; // second letter of output output = output + first + second; // build output Sample Interaction Enter your name in 'Last, First M.' format: Hogan, Douglas J. Reformatted name: Douglas J. Hogan Initials: DJH Submission • Code • Three sample runs • (No discussion required this time)...
View Full Document
- Fall '10
- Empty string, C++ string Class, Douglas J. Hogan