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
... double: "};
14     string string4{"\n           int: "};
15     string string5{"\naddress of int: "};
16
17     double double1{123.4567};
18     int integer{22};
19
20     // output strings, double and int to ostringstream outputString
21     outputString << string1 << string2 << string3 << double1       
22        << string4 << integer << string5 << &integer;               
23
24     // call str to obtain string contents of the ostringstream
25     cout << "outputString contains:\n" << outputString.str(); 
26
27     // add additional characters and call str to output string
28     outputString << "\nmore characters added";
29     cout << "\n\nafter additional stream insertions,\n" 
30        << "outputString contains:\n" << outputString.str() << endl;
31  }

outputString contains: Output of several data types to an ostringstream object: ...
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