[ Viewing Hints ] [ Book Home Page ] [ Free Newsletter ] [ Seminars ] [ Seminars on CD ROM ] [ Consulting ] Annotated Solution Guide Revision 1
0 for Thinking in C++, 2nd edition, Volume 1by Chuck Allison
2001 MindView, Inc
All Rights Reserved
[ Previous Chapter ] [ Table of Contents ] [ Next Chapter ] Chapter 77-1Create a Text class that contains a string object to hold the text of a file
Give it two constructors: a default constructor and a constructor that takes a string argument that is the name of the file to open
When the second constructor is used, open the file and read the contents into the stringmember object
Add a member function contents( ) to return the string so (for example) it can be printed
In main( ) , open a file using Text and print the contents
Solution://: S07