This preview shows page 1. Sign up to view the full content.
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
This document was uploaded on 02/10/2011.
- Fall '10