Skip to Content
C++ How to Program, 10/e
book

C++ How to Program, 10/e

by Paul Deitel, Harvey Deitel
February 2016
Beginner
1080 pages
207h 57m
English
Pearson
Content preview from C++ How to Program, 10/e
... "beginning end"};
 9     string string2{"middle "};
10     string string3{"12345678"};
11     string string4{"xx"};
12
13     cout << "Initial strings:\nstring1: " << string1
14        << "\nstring2: " << string2 << "\nstring3: " << string3
15        << "\nstring4: " << string4 << "\n\n";
16
17     // insert "middle" at location 10 in string1
18     string1.insert(10, string2);
19
20     // insert "xx" at location 3 in string3
21     string3.insert(3, string4, 0, string::npos);
22
23     cout << "Strings after insert:\nstring1: " << string1
24        << "\nstring2: " << string2 << "\nstring3: " << string3
25        << "\nstring4: " << string4 << endl;
26  }
 Initial strings: string1: beginning end string2: middle string3: 12345678 string4: xx Strings after insert: string1: beginning middle end string2: middle string3: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ How to Program, Sixth Edition

C++ How to Program, Sixth Edition

P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.
C++ How to Program, Ninth Edition

C++ How to Program, Ninth Edition

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9780134448930Purchase book