100% found this document useful (1 vote)
39 views53 pages

Data Structures and Other Objects Using C++ 4th Edition Edition Michael Main download

The document discusses the 4th edition of 'Data Structures and Other Objects Using C++' by Michael Main and Walter Savitch, which serves as a textbook for a second course in computer science. It emphasizes data type specification, design, implementation, and usage, while introducing the C++ Standard Template Library (STL) more prominently than in previous editions. The text is structured to cater to students with varying backgrounds in programming, providing a comprehensive understanding of data structures and object-oriented programming in C++.

Uploaded by

jebsasipt9905
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
39 views53 pages

Data Structures and Other Objects Using C++ 4th Edition Edition Michael Main download

The document discusses the 4th edition of 'Data Structures and Other Objects Using C++' by Michael Main and Walter Savitch, which serves as a textbook for a second course in computer science. It emphasizes data type specification, design, implementation, and usage, while introducing the C++ Standard Template Library (STL) more prominently than in previous editions. The text is structured to cater to students with varying backgrounds in programming, providing a comprehensive understanding of data structures and object-oriented programming in C++.

Uploaded by

jebsasipt9905
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

Data Structures and Other Objects Using C++ 4th

Edition Edition Michael Main download pdf

https://ebookmass.com/product/data-structures-and-other-objects-
using-c-4th-edition-edition-michael-main/

Visit ebookmass.com today to download the complete set of


ebook or textbook!
Here are some recommended products for you. Click the link to
download, or explore more at ebookmass.com

Data Structures and Algorithm Analysis in C++ 4th Edition,


(Ebook PDF)

https://ebookmass.com/product/data-structures-and-algorithm-analysis-
in-c-4th-edition-ebook-pdf/

Data Structures and Algorithms in C++ 2nd Edition

https://ebookmass.com/product/data-structures-and-algorithms-in-c-2nd-
edition/

Starting Out with C++: From Control Structures through


Objects 8th Edition, (Ebook PDF)

https://ebookmass.com/product/starting-out-with-c-from-control-
structures-through-objects-8th-edition-ebook-pdf/

Starting out with c++ From control structures through


objects Ninth Edition, Global Edition Tony Gaddis

https://ebookmass.com/product/starting-out-with-c-from-control-
structures-through-objects-ninth-edition-global-edition-tony-gaddis/
Data structure using C Reema Thareja

https://ebookmass.com/product/data-structure-using-c-reema-thareja/

C++ Programming. Program Design including Data Structures


8th Edition D.S. Malik

https://ebookmass.com/product/c-programming-program-design-including-
data-structures-8th-edition-d-s-malik/

Data Parallel C++: Programming Accelerated Systems Using


C++ and SYCL 2nd Edition James Reinders

https://ebookmass.com/product/data-parallel-c-programming-accelerated-
systems-using-c-and-sycl-2nd-edition-james-reinders/

Statistics: Informed Decisions Using Data 4th Edition,


(Ebook PDF)

https://ebookmass.com/product/statistics-informed-decisions-using-
data-4th-edition-ebook-pdf/

Data Parallel C++ : Programming Accelerated Systems Using


C++ and SYCL James Reinders

https://ebookmass.com/product/data-parallel-c-programming-accelerated-
systems-using-c-and-sycl-james-reinders/
Preface i

DATA
STRUCTURES
&
OTHER
OBJECTS
Using C++ 4TH
EDITION

MICHAEL MAIN
Department of Computer Science
University of Colorado at Boulder

WALTER SAVITCH
Department of Computer Science
and Engineering
University of California, San Diego

Addison-Wesley

Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto

Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
ii Preface
Editor-in-Chief: Michael Hirsch Marketing Manager: Erin Davis
Editorial Assistant: Stephanie Sellinger Marketing Coordinator: Kathryn Ferranti
Managing Editor: Jeffrey Holcomb Art Director: Linda Knowles
Production Project Manager: Heather McNally Cover Designer: Elena Sidorova
Copy Editor: Sada Preisch Cover Artwork: © 2010 Stocksearch / Alamy
Proofreader: Genevieve d’Entremont Senior Manufacturing Buyer: Carol Melville

Access the latest information about all Pearson Addison-Wesley Computer Science titles from our World
Wide Web site: http://www.pearsonhighered.com/cs

The programs and applications presented in this book have been included for their instructional value. They
have been tested with care, but are not guaranteed for any particular purpose. The publisher does not offer any
warranties or representations, nor does it accept any liabilities with respect to the programs or applications.

Credits and acknowledgments borrowed from other sources and reproduced, with permission, in this textbook
appear on appropriate page within text.

UNIX® is a registered trademark in the United States and other countries, licensed exclusively through X-Open
Company, Ltd. Pez® is a registered trademark of Pez Candy, Inc.

Copyright © 2011, 2005, 2001, 1997 Pearson Education, Inc., publishing as Addison-Wesley, 501 Boylston
Street, Suite 900, Boston MA 02116. All rights reserved. Manufactured in the United States of America. This
publication is protected by Copyright, and permission should be obtained from the publisher prior to any
prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic,
mechanical, photocopying, recording, or likewise. To obtain permission(s) to use material from this work,
please submit a written request to Pearson Education, Inc., Permissions Department, , 501 Boylston Street,
Suite 900, Boston MA 02116.

Many of the designations by manufacturers and seller to distinguish their products are claimed as trademarks.
Where those designations appear in this book, and the publisher was aware of a trademark claim, the
designations have been printed in initial caps or all caps.

Library of Congress Cataloging-in-Publication Data


Main, M. (Michael), 1956–
Data structures and other objects using C++ / Michael Main, Walter Savitch.-- 4th ed.
p. cm.
Includes index.
ISBN 978-0-13-212948-0 (pbk.)
1. C++ (Computer program language) 2. Data structures (Computer science) 3. Object-oriented
programming (Computer science) I. Savitch, Walter J., 1943– II. Title.

QA76.73.C153M25 2010
005.13’3—dc22
2009049328
CIP
1 2 3 4 5 6 7 8 9 10--CRS--14 13 12 11 10

ISBN 10: 0-13-212948-5


ISBN 13: 978-0-13-212948-0
Preface iii

Preface

T his book is written for a second course in computer science,


the CS 2 course at many universities. The text’s emphasis is on the
specification, design, implementation, and use of the basic data types that
normally are covered in a second-semester course. In addition, we cover a
range of important programming techniques and provide self-contained cov-
erage of abstraction techniques, object-oriented programming, big-O time
analysis of algorithms, and sorting.
We assume that the student has already had an introductory computer sci-
ence and programming class, but we do include coverage of those topics (such
as recursion and pointers) that are not always covered completely in a first
course. The text uses C++, but our coverage of C++ classes begins from
scratch, so the text may be used by students whose introduction to program-
ming was in C rather than C++. In our experience, such students need a brief
coverage of C++ input and output techniques (such as those provided in Appen-
dix F) and some coverage of C++ parameter types (which we provide in Chap-
ter 2). When C programmers are over the input/output hurdle and the parameter
hurdle (and perhaps a small “fear” hurdle), they can step readily into classes
and other object-oriented features of C++. As this indicates, there are several
pathways through the text that can be tailored to different backgrounds, includ-
ing some optional features for the student who comes to the class with a stron-
ger than usual background.

New to This Edition


The C++ Standard Template Library (STL) plays a larger role in our curricu-
lum than past editions, and we have added selected new material to support
this. For us, it’s important that our students understand both how to use the
STL classes in an application program and the possible approaches to imple- iii
iv Preface

menting these (or similar) classes. With this in mind, the primary changes that
you’ll find for this edition are:
• A new Section 2.6 that gives an early introduction to the Standard Tem-
plate Library using the pair class. We have been able to introduce students
to the STL here even before they have a full understanding of templates.
• An earlier introduction of the multiset class and STL iterators in Section
3.4. This is a good location for the material because the students have just
seen how to implement their first collection class (the bag), which is
based on the multiset.
• We continue to introduce the STL string class in Section 4.5, where it’s
appropriate for the students to implement their own string class with a
dynamic array.
• A new Section 5.6 that compares three similar STL classes: the vector, the
list, and the deque. At this point, the students have enough knowledge to
understand typical vector and list implementations.
• A first introduction to the STL algorithms appears in Section 6.3, and this
is now expanded on in Sections 11.2 (the heap algorithms) and 13.4
(expanded coverage of sorting and binary search in the STL).
• A new Section 8.4 provides typical implementation details for the STL
deque class using an interesting combination of dynamic arrays and point-
ers.
• A discussion of hash tables in the proposed TR1 expansions for the STL
is now given in Section 12.6.

Most chapters also include new programming projects, and you may also keep
an eye on our project web site, www.cs.colorado.edu/~main/dsoc.html, for new
projects as we develop them.

The Steps for Each Data Type


Overall, the fourth edition remains committed to the data types: sets, bags (or
multisets), sequential lists, ordered lists (with ordering from a “less than” opera-
tor), stacks, queues, tables, and graphs. There are also additional supplemental
data types such as a priority queue. Each of these data types is introduced fol-
lowing a consistent pattern:

Step 1: Understand the data type abstractly. At this level, a student gains an
understanding of the data type and its operations at the level of concepts and
pictures. For example, a student can visualize a stack and its operations of push-
ing and popping elements. Simple applications are understood and can be car-
ried out by hand, such as using a stack to reverse the order of letters in a word.

Step 2: Write a specification of the data type as a C++ class. In this step,
the student sees and learns how to write a specification for a C++ class that can
Preface v

implement the data type. The specification includes prototypes for the construc-
tors, public member functions, and sometimes other public features (such as an
underlying constant that determines the maximum size of a stack). The prototype
of each member function is presented along with a precondition/postcondition
contract that completely specifies the behavior of the function. At this level, it’s
important for the students to realize that the specification is not tied to any par-
ticular choice of implementation techniques. In fact, this same specification may
be used several times for several different implementations of the same data type.

Step 3: Use the data type. With the specification in place, students can write
small applications or demonstration programs to show the data type in use.
These applications are based solely on the data type’s specification, as we still
have not tied down the implementation.

Step 4: Select appropriate data structures, and proceed to design and


implement the data type. With a good abstract understanding of the data
type, we can select an appropriate data structure, such as a fixed-sized array, a
dynamic array, a linked list of nodes, or a binary tree of nodes. For many of our
data types, a first design and implementation will select a simple approach, such
as a fixed-sized array. Later, we will redesign and reimplement the same data
type with a more complicated underlying structure.
Since we are using C++ classes, an implementation of a data type will have
the selected data structures (arrays, pointers, etc.) as private member variables of
the class. With each implemented class, we stress the necessity for a clear under-
standing of the rules that relate the private member variables to an abstract notion
of the data type. We require each student to write these rules in clear English sen-
tences that we call the invariant of the abstract data type. Once the invariant is
written, students can proceed to implementing various member functions. The
invariant helps in writing correct functions because of two facts: (a) Each func-
tion (except constructors) knows that the invariant is true when the function
begins its work; and (b) each function (except the destructor) is responsible for
ensuring that the invariant is again true when the function finishes.
Step 5: Analyze the implementation. Each implementation can be analyzed
for correctness, flexibility (such as a fixed size versus dynamic size), and time
analysis of the operations (using big-O notation). Students have a particularly
strong opportunity for these analyses when the same data type has been imple-
mented in several different ways.

Where Will the Students Be at the End of the Course?


At the end of our course, students understand the data types inside out. They
know how to use the data types, they know how to implement them several
ways, and they know the practical effects of the different implementation
choices. The students can reason about efficiency with a big-O analysis and
vi Preface

argue for the correctness of their implementations by referring to the invariant


of the class.
One of the important lasting effects of the course is the specification, design,
and implementation experience. The improved ability to reason about programs
is also important. But perhaps most important of all is the exposure to classes that
are easily used in many situations. The students no longer have to write every-
thing from scratch. We tell our students that someday they will be thinking about
a problem, and they will suddenly realize that a large chunk of the work can be
done with a bag, or a stack, or a queue, or some such. And this large chunk of
work is work that they won’t have to do. Instead, they will pull out the bag or
stack or queue or some such that they wrote this semester—using it with no mod-
ifications. Or, more likely, they will use the familiar data type from a library of
standard data types, such as the C++ Standard Template Library. In fact, the
behavior of the data types in this text is a cut-down version of the Standard Tem-
plate Library, so when students take the step to the real STL, they will be on
familiar ground. And at that point of realization, knowing that a certain data type
is the exact solution he or she needs, the student becomes a real programmer.

Other Foundational Topics


Throughout the course, we also lay a foundation for other aspects of “real pro-
gramming,” with coverage of the following topics beyond the basic data struc-
tures material:

Object-oriented programming. The foundations of object-oriented program-


ming (OOP) are laid by giving students a strong understanding of C++ classes.
The important aspects of classes are covered early: the notion of a member
function, the separation into private and public members, the purpose of con-
structors, and a small exposure to operator overloading. This is enough to get
students going and excited about classes.
Further major aspects of classes are introduced when the students first use
dynamic memory (Chapter 4). At this point, the need for three additional items
is explained: the copy constructor, the overloaded assignment operator, and the
destructor. Teaching these OOP aspects with the first use of dynamic memory
has the effect of giving the students a concrete picture of dynamic memory as a
resource that can be taken and must later be returned.
Conceptually, the largest innovation of OOP is the software reuse that occurs
via inheritance. And there are certainly opportunities for introducing inheritance
right from the start of a data structures course (such as implementing a set class
as a descendant of a bag class). However, an early introduction may also result
in juggling too many new concepts at once, resulting in a weaker understanding
of the fundamental data structures. Therefore, in our own course we introduce
inheritance at the end as a vision of things to come. But the introduction to inher-
itance (Sections 14.1 and 14.2) could be covered as soon as copy constructors are
Preface vii

understood. With this in mind, some instructors may wish to cover Chapter 14
earlier, just before stacks and queues.
Another alternative is to identify students who already know the basics of
classes. These students can carry out an inheritance project (such as the ecosys-
tem of Section 14.2 or the game engine in Section 14.3) while the rest of the stu-
dents first learn about classes.

Templates. Template functions and template classes are an important part of


the proposed Standard Template Library, allowing a programmer to easily
change the type of the underlying item in a container class. Template classes
also allow the use of several different instantiations of a class in a single pro-
gram. As such, we think it’s important to learn about and use templates (Chapter
6) prior to stacks (Chapter 7), since expression evaluation is an important appli-
cation that uses two kinds of stacks.

Iterators. Iterators are another important part of the proposed Standard Tem-
plate Library, allowing a programmer to easily step through the items in a con-
tainer object (such as the elements of a set or bag). Such iterators may be
internal (implemented with member functions of the container class) or external
(implemented by a separate class that is a friend of the container class). We
introduce internal iterators with one of the first container classes (a sequential
list in Section 3.2). An internal iterator is added to the bag class when it is
needed in Chapter 6. At that point, the more complex external iterators also are
discussed, and students should be aware of the advantages of an external itera-
tor. Throughout the text, iterators provide a good opportunity for programming
projects, such as implementing an external bag iterator (Chapter 6) or using a
stack to implement an internal iterator of a binary search tree (Chapter 10).

Recursion. First-semester courses sometimes introduce students to recursion.


But many of the first-semester examples are tail recursion, where the final act of
the function is the recursive call. This may have given students a misleading
impression that recursion is nothing more than a loop. Because of this, we prefer
to avoid early use of tail recursion in a second-semester course. For example,
list traversal and other operations on linked lists can be implemented with tail
recursion, but the effect may reinforce wrong impressions about recursion (and
the tail recursive list operations may need to be unlearned when the students
work with lists of thousands of items, running into potential run-time stack
overflow).
So, in our second-semester course, we emphasize recursive solutions that use
more than tail recursion. The recursion chapter provides three examples along
these lines. Two of the examples—generating random fractals and traversing a
maze—are big hits with the students. In our class, we teach recursion (Chapter
9) just before trees (Chapter 10), since it is in recursive tree algorithms that recur-
sion becomes vital. However, instructors who desire more emphasis on recursion
can move that topic forward, even before Chapter 2.
viii Preface

In a course that has time for advanced tree projects (Chapter 11), we analyze
the recursive tree algorithms, explaining the importance of keeping the trees
balanced—both to improve worst-case performance, and to avoid potential run-
time stack overflow.

Searching and sorting. Chapters 12 and 13 provide fundamental coverage of


searching and sorting algorithms. The searching chapter reviews binary search
of an ordered array, which many students will have seen before. Hash tables
also are introduced in the search chapter. The sorting chapter reviews simple
quadratic sorting methods, but the majority of the chapter focuses on faster
algorithms: the recursive merge sort (with worst-case time of O(n log n)), Tony
Hoare’s recursive quicksort (with average-time O(n log n)), and the tree-based
heap sort (with worst-case time of O(n log n)). There is also a new introduction
to the C++ Standard Library sorting functions.

Advanced Projects
The text offers good opportunities for optional projects that can be undertaken
by a more advanced class or by students with a stronger background in a large
class. Particular advanced projects include the following:
• A polynomial class using dynamic memory (Section 4.6).
• An introduction to Standard Library iterators, culminating in an imple-
mentation of an iterator for the student’s bag class (Sections 6.3 through
6.5).
• An iterator for the binary search tree (Programming Projects in Chapter
10).
• A priority queue, implemented with a linked list (Chapter 8 projects), or
implemented using a heap (Section 11.1).
• A set class, implemented with B-trees (Section 11.3). We have made a
particular effort on this project to provide information that is sufficient for
students to implement the class without need of another text. In our
courses, we have successfully directed advanced students to do this
project as independent work.
• An inheritance project, such as the ecosystem of Section 14.2.
• An inheritance project using an abstract base class such as the game base
class in Section 14.3 (which allows easy implementation of two-player
games such as Othello or Connect Four).
• A graph class and associated graph algorithms from Chapter 15. This is
another case where advanced students may do work on their own.
Preface ix

C++ Language Features


C++ is a complex language with many advanced features that will not be
touched in a second-semester course. But we endeavor to provide complete
coverage for those features that we do touch. In the first edition of the text, we
included coverage of two features that were new to C++ at the time: the new
bool data type (Figure 2.1 on page 37) and static member constants (see
page 104). The requirements for using static member constants were changed in
the 1998 Standard, and we have incorporated this change into the text (the
constant must now be declared both inside and outside the class definition). The
other primary new feature from the 1998 Standard is the use of namespaces,
which were incorporated in the second edition. In each of these cases, these
features might not be supported in older compilers. We provide some assistance
in dealing with this (see Appendix E, “Dealing with Older Compilers”), and
some assistance in downloading and installing the GNU g++ compiler (see
Appendix K).

Flexibility of Topic Ordering


This book was written to allow instructors latitude in reordering the material to
meet the specific background of students or to add early emphasis to selected
topics. The dependencies among the chapters are shown on page xi. A line join-
ing two boxes indicates that the upper box should be covered before the lower
box.
Here are some suggested orderings of the material:

Typical course. Start with Chapters 1–10, skipping parts of Chapter 2 if the
students have a prior background in C++ classes. Most chapters can be covered
in a week, but you may want more time for Chapter 5 (linked lists), Chapter 6
(templates), Chapter 9 (recursion), or Chapter 10 (trees). Typically, we cover the
material in 13 weeks, including time for exams and extra time for linked lists
and trees. Remaining weeks can be spent on a tree project from Chapter 11, or
on binary search (Section 12.1) and sorting (Chapter 13).

Heavy OOP emphasis. If students cover sorting and searching elsewhere,


there will be time for a heavier emphasis on object-oriented programming. The
first four chapters are covered in detail, and then derived classes (Section 14.1)
are introduced. At this point, students can do an interesting OOP project, based
on the ecosystem of Section 14.2 or the games in Section 14.3. The basic data
structures are then covered (Chapters 5–8), with the queue implemented as a
derived class (Section 14.3). Finish up with recursion (Chapter 9) and trees
(Chapter 10), placing special emphasis on recursive member functions.

Accelerated course. Assign the first three chapters as independent reading in


the first week, and start with Chapter 4 (pointers). This will leave two to three
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
x Preface

extra weeks at the end of the term, so that students may spend more time on
searching, sorting, and the advanced topics (shaded on page xi.)
We also have taught the course with further acceleration by spending no lec-
ture time on stacks and queues (but assigning those chapters as reading).

Early recursion / early sorting. One to three weeks may be spent at the start
of class on recursive thinking. The first reading will then be Chapters 1 and 9,
perhaps supplemented by additional recursive projects.
If recursion is covered early, you may also proceed to cover binary search
(Section 12.1) and most of the sorting algorithms (Chapter 13) before introduc-
ing C++ classes.

Supplements via the Internet


The following supplemental materials for this text are available to all readers at
www.aw-bc.com/cssupport:
• Source code. All the C++ classes, functions, and programs that appear in
the book are available to readers.
• Errata. We have tried not to make mistakes, but sometimes they are
inevitable. A list of detected errors is available and updated as necessary.
You are invited to contribute any errors you find.

In addition, the following supplements are available to qualified instructors at


www.pearsonhighered.com/irc. Please contact your Addison-Wesley sales rep-
resentative, or send email to [email protected], for information on how to
access them:
• PowerPoint lecture slides
• Exam questions
• Solutions to selected programming projects
• Sample assignments and lab exercises
• Suggested syllabi
Preface xi

Chapter Dependencies

At the start of the course, students should be comfortable writing functions and using
arrays in C++ or C. Those who have used only C should read Appendix F and pay
particular attention to the discussion of reference parameters in Section 2.4.

Chapter 1
Introduction

Chapters 2, 3, and 4.1–4.4


Classes
Container Classes
Pointers and Dynamic Memory Chapter 9
Recursion
Chapter 2 may be skipped by students
with a good background in C++ classes.

Chapter 5 Section 12.1


Linked Lists Binary Search
Sections 4.5–4.6
Projects:
String Class Sections 6.1–6.2
Templates Sec. 12.2–12.3
Polynomial Hash Tables
(Also requires
6.1–6.2)
Chapter 7
Sections 6.3–6.6 Stacks
More Templates
and Iterators Chapter 13
Sorting
Chapter 8 Chapter 10 (Heapsort also
Queues Trees needs Sec. 11.1)
Sections 14.1–14.2
Derived Classes
Section 11.1-2 Section 11.3 Chapter 15
Heaps B-Trees Graphs

Section 14.3
Virtual Methods Section 11.4
Detailed Tree Analysis
The shaded boxes provide
good opportunities for
advanced work.
xii Preface

Acknowledgments
We started this book while Walter was visiting Michael at the Computer Science
Department of the University of Colorado in Boulder. The work was completed
after Walter moved back to the Department of Engineering and Computer Sci-
ence at the University of California, San Diego. We are grateful to these institu-
tions for providing facilities, wonderful students, and interaction with congenial
colleagues.
Our students have been particularly helpful—nearly 5000 of our students
worked through the material, making suggestions, showing us how they learned.
We thank the reviewers and instructors who used the material in their data struc-
tures courses and provided feedback: Zachary Bergen, Cathy Bishop, Martin
Burtscher, Gina Cherry, Courtney Comstock, Stephen Davies, Robert Frohardt,
John Gillett, Mike Hendricks, Ralph Hollingsworth, Yingdan Huang, Patrick
Lynn, Ron McCarty, Shivakant Mishra, Evi Nemeth, Rick Osborne, Rachelle
Reese, and Nicholas Tran. The book was also extensively reviewed by Wolfgang
W. Bein, Bill Hankley, Michael Milligan, Paul Nagin, Jeff Parker, Andrew L.
Wright, John R. Rose, and Evan Zweifel. We thank these colleagues for their
excellent critique and their encouragement.
Thank you to Lesley McDowell and Chris Schenk, who are pleasant and
enthusiastic every day in the computer science department at the University of
Colorado. Our thanks also go to the editors and staff at Addison-Wesley. Heather
McNally’s work has encouraged us and provided us with smooth interaction on
a daily basis and eased every step of the production. Karin Dejamaer and Jessica
Hector provided friendly encouragement in Boulder, and we offer our thanks to
them. We welcome and appreciate Michael Hirsch in the role of editor, where he
has shown amazing energy, enthusiasm, and encouragement. Finally, our origi-
nal editor, Susan Hartman, has provided continual support, encouragement, and
direction—the book wouldn’t be here without you!
In addition to the work and support from those who put the book together, we
thank those who offered us daily interest and encouragement. Our deepest thanks
go to Holly Arnold, Vanessa Crittenden, Meredith Boyles, Suzanne Church, Erika
Civils, Lynne Conklin, Andrzej Ehrenfeucht, Paul Eisenbrey, Skip Ellis, John
Kennedy, Rick Lowell, George Main, Mickey Main, Jesse Nuzzi, Ben Powell,
Marga Powell, Megan Powell, Grzegorz Rozenberg, Hannah, Timothy, and
Janet.

Michael Main Walter Savitch


[email protected] [email protected]
Boulder, Colorado San Diego, California
Contents xv

Contents

CHAPTER 1 THE PHASES OF SOFTWARE DEVELOPMENT


1.1 Specification, Design, Implementation 3
Design Concept: Decomposing the Problem 4
Preconditions and Postconditions 6
Using Functions Provided by Other Programmers 8
Implementation Issues for the ANSI/ISO C++ Standard 8
C++ Feature: The Standard Library and the Standard Namespace 9
Programming Tip: Use Declared Constants 11
Clarifying the Const Keyword
Part 1: Declared Constants 12
Programming Tip: Use Assert to Check a Precondition 12
Programming Tip: Use EXIT_SUCCESS in a Main Program 14
C++ Feature: Exception Handling 14
Self-Test Exercises for Section 1.1 14
1.2 Running Time Analysis 15
The Stair-Counting Problem 15
Big-O Notation 21
Time Analysis of C++ Functions 23
Worst-Case, Average-Case, and Best-Case Analyses 25
Self-Test Exercises for Section 1.2 25
1.3 Testing and Debugging 26
Choosing Test Data 26
Boundary Values 27
Fully Exercising Code 28
Debugging 28
Programming Tip: How to Debug 28
Self-Test Exercises for Section 1.3 29
Chapter Summary 30
Solutions to Self-Test Exercises 31

CHAPTER 2 ABSTRACT DATA TYPES AND C++ CLASSES


2.1 Classes and Members 34
Programming Example: The Throttle Class 34
Clarifying the Const Keyword
Part 2: Constant Member Functions 38
Using a Class 39
A Small Demonstration Program for the Throttle Class 40
Implementing Member Functions 42
Member Functions May Activate Other Members 44
Programming Tip: Style for Boolean Variables 44
Self-Test Exercises for Section 2.1 45
xvi Contents

2.2 Constructors 45
The Throttle’s Constructor 46
What Happens If You Write a Class with No Constructors? 49
Programming Tip: Always Provide Constructors 49
Revising the Throttle’s Member Functions 49
Inline Member Functions 49
Programming Tip: When to Use an Inline Member Function 50
Self-Test Exercises for Section 2.2 51
2.3 Using a Namespace, Header File, and Implementation File 51
Creating a Namespace 51
The Header File 52
Describing the Value Semantics of a Class Within the Header File 56
Programming Tip: Document the Value Semantics 57
The Implementation File 57
Using the Items in a Namespace 59
Pitfall: Never Put a Using Statement Actually in a Header File 60
Self-Test Exercises for Section 2.3 62
2.4 Classes and Parameters 63
Programming Example: The Point Class 63
Default Arguments 65
Programming Tip: A Default Constructor Can Be Provided by Using Default
Arguments 66
Parameters 67
Pitfall: Using a Wrong Argument Type for a Reference Parameter 70
Clarifying the Const Keyword
Part 3: Const Reference Parameters 72
Programming Tip: Use const Consistently 73
When the Type of a Function’s Return Value Is a Class 73
Self-Test Exercises for Section 2.4 74
2.5 Operator Overloading 74
Overloading Binary Comparison Operators 75
Overloading Binary Arithmetic Operators 76
Overloading Output and Input Operators 77
Friend Functions 80
Programming Tip: When to Use a Friend Function 81
The Point Class—Putting Things Together 82
Summary of Operator Overloading 85
Self-Test Exercises for Section 2.5 85
2.6 The Standard Template Libary and the Pair Class 86
Chapter Summary 87
Solutions to Self-Test Exercises 88
Programming Projects 90
Contents xvii

CHAPTER 3 CONTAINER CLASSES


3.1 The Bag Class 97
The Bag Class—Specification 98
C++ Feature: Typedef Statements Within a Class Definition 99
C++ Feature: The std::size_t Data Type 100
Clarifying the Const Keyword
Part 4: Static Member Constants 104
Older Compilers Do Not Support Initialization of Static Member Constants 105
The Bag Class—Documentation 105
Documenting the Value Semantics 107
The Bag Class—Demonstration Program 107
The Bag Class—Design 109
Pitfall: The value_type Must Have a Default Constructor 110
The Invariant of a Class 110
The Bag Class—Implementation 111
Pitfall: Needing to Use the Full Type Name bag::size_type 112
Programming Tip: Make Assertions Meaningful 112
C++ Feature: The Copy Function from the C++ Standard Library 116
The Bag Class—Putting the Pieces Together 117
Programming Tip: Document the Class Invariant in the Implementation File 117
The Bag Class—Testing 121
Pitfall: An Object Can Be an Argument to Its Own Member Function 121
The Bag Class—Analysis 122
Self-Test Exercises for Section 3.1 123
3.2 Programming Project: The Sequence Class 124
The Sequence Class—Specification 124
The Sequence Class—Documentation 127
The Sequence Class—Design 127
The Sequence Class—Pseudocode for the Implementation 130
Self-Test Exercises for Section 3.2 132
3.3 Interactive Test Programs 133
C++ Feature: Converting Input to Uppercase Letters 134
C++ Feature: The Switch Statement 138
Self-Test Exercises for Section 3.3 138
3.4 The STL Multiset Class and Its Iterator 139
The Multiset Template Class 139
Some Multiset Members 140
Iterators and the [...) Pattern 140
Pitfall: Do Not Access an Iterator’s Item After Reaching end( ) 142
Testing Iterators for Equality 143
Other Multiset Operations 143
Invalid Iterators 144
Clarifying the Const Keyword
Part 5: Const Iterators 144
Pitfall: Changing a Container Object Can Invalidate Its Iterators 144
Self-Test Exercises for Section 3.4 145
Chapter Summary 146
Solutions to Self-Test Exercises 146
Programming Projects 149
xviii Contents

CHAPTER 4 POINTERS AND DYNAMIC ARRAYS


4.1 Pointers and Dynamic Memory 155
Pointer Variables 156
Using the Assignment Operator with Pointers 158
Dynamic Variables and the new Operator 159
Using new to Allocate Dynamic Arrays 160
The Heap and the bad_alloc Exception 163
The delete Operator 163
Programming Tip: Define Pointer Types 164
Self-Test Exercises for Section 4.1 165
4.2 Pointers and Arrays as Parameters 166
Clarifying the Const Keyword
Part 6: Const Parameters That Are Pointers or Arrays 171
Self-Test Exercises for Section 4.2 173
4.3 The Bag Class with a Dynamic Array 176
Pointer Member Variables 176
Member Functions Allocate Dynamic Memory as Needed 177
Programming Tip: Provide Documentation about Possible Dynamic Memory
Failure 181
Value Semantics 181
The Destructor 184
The Revised Bag Class—Class Definition 185
The Revised Bag Class—Implementation 187
Programming Tip: How to Check for Self-Assignment 188
Programming Tip: How to Allocate Memory in a Member Function 191
The Revised Bag Class—Putting the Pieces Together 192
Self-Test Exercises for Section 4.3 194
4.4 Prescription for a Dynamic Class 195
Four Rules 195
Special Importance of the Copy Constructor 195
Pitfall: Using Dynamic Memory Requires a Destructor, a Copy Constructor, and an
Overloaded Assignment Operator 196
Self-Test Exercises for Section 4.4 197
Contents xix

4.5 The STL String Class and a Project 197


Null-Terminated Strings 197
Initializing a String Variable 198
The Empty String 198
Reading and Writing String Variables 199
Pitfall: Using = and == with Strings 199
The strcpy Function 199
The strcat Function 200
Pitfall: Dangers of strcpy, strcat, and Reading Strings 200
The strlen Function 201
The strcmp Function 201
The String Class—Specification 201
Constructor for the String Class 203
Overloading the Operator [ ] 204
Some Further Overloading 204
Other Operations for the String Class 205
The String Class—Design 205
The String Class—Implementation 206
Demonstration Program for the String Class 208
Chaining the Output Operator 210
Declaring Constant Objects 210
Constructor-Generated Conversions 210
Using Overloaded Operations in Expressions 211
Our String Class Versus the C++ Library String Class 211
Self-Test Exercises for Section 4.5 211
4.6 Programming Project: The Polynomial 212
Chapter Summary 216
Solutions to Self-Test Exercises 216
Programming Projects 218

CHAPTER 5 LINKED LISTS


5.1 A Fundamental Node Class for Linked Lists 221
Declaring a Class for Nodes 221
Using a Typedef Statement with Linked-List Nodes 222
Head Pointers, Tail Pointers 223
The Null Pointer 224
The Meaning of a Null Head Pointer or Tail Pointer 224
The Node Constructor 224
The Node Member Functions 225
The Member Selection Operator 226
Clarifying the Const Keyword
Part 7: The Const Keyword with a Pointer to a Node, and the Need for Two
Versions of Some Member Functions 227
Programming Tip: A Rule for a Node’s Constant Member Functions 228
Pitfall: Dereferencing the Null Pointer 230
Self-Test Exercises for Section 5.1 230
xx Contents

5.2 A Linked-List Toolkit 231


Linked-List Toolkit—Header File 232
Computing the Length of a Linked List 232
Programming Tip: How to Traverse a Linked List 235
Pitfall: Forgetting to Test the Empty List 236
Parameters for Linked Lists 236
Inserting a New Node at the Head of a Linked List 238
Inserting a New Node That Is Not at the Head 240
Pitfall: Unintended Calls to delete and new 243
Searching for an Item in a Linked List 245
Finding a Node by Its Position in a Linked List 246
Copying a Linked List 247
Removing a Node at the Head of a Linked List 250
Removing a Node That Is Not at the Head 251
Clearing a Linked List 252
Linked-List Toolkit—Putting the Pieces Together 253
Using the Linked-List Toolkit 254
Self-Test Exercises for Section 5.2 258
5.3 The Bag Class with a Linked List 259
Our Third Bag—Specification 259
Our Third Bag—Class Definition 259
How to Make the Bag value_type Match the Node value_type 260
Following the Rules for Dynamic Memory Usage in a Class 263
The Third Bag Class—Implementation 264
Pitfall: The Assignment Operator Causes Trouble with Linked Lists 265
Programming Tip: How to Choose Between Approaches 267
The Third Bag Class—Putting the Pieces Together 271
Self-Test Exercises for Section 5.3 272
5.4 Programming Project: The Sequence Class with a Linked List 275
The Revised Sequence Class—Design Suggestions 275
The Revised Sequence Class—Value Semantics 276
Self-Test Exercises for Section 5.4 277
5.5 Dynamic Arrays vs. Linked Lists vs. Doubly Linked Lists 277
Making the Decision 279
Self-Test Exercises for Section 5.5 279
5.6 STL Vectors vs. STL Lists vs. STL Deques 280
Self-Test Exercises for Section 5.6 282
Chapter Summary 283
Solutions to Self-Test Exercises 283
Programming Projects 287
Contents xxi

CHAPTER 6 SOFTWARE DEVELOPMENT WITH TEMPLATES,


ITERATORS, AND THE STL
6.1 Template Functions 291
Syntax for a Template Function 293
Programming Tip: Capitalize the Name of a Template Parameter 293
Using a Template Function 294
Pitfall: Failed Unification Errors 294
A Template Function to Swap Two Values 296
Programming Tip: Swap, Max, and Min Functions 296
Parameter Matching for Template Functions 296
A Template Function to Find the Biggest Item in an Array 297
Pitfall: Mismatches for Template Function Arguments 299
A Template Function to Insert an Item into a Sorted Array 299
Self-Test Exercises for Section 6.1 301
6.2 Template Classes 301
Syntax for a Template Class 301
Programming Tip: Use the Name Item and the typename Keyword 303
Pitfall: Do Not Place Using Directives in a Template Implementation 304
More About the Template Implementation File 304
Parameter Matching for Member Functions of Template Classes 309
Using the Template Class 309
Details of the Story-Writing Program 312
Self-Test Exercises for Section 6.2 312
6.3 The STL’s Algorithms and Use of Iterators 313
STL Algorithms 313
Standard Categories of Iterators 314
Iterators for Arrays 316
Self-Test Exercises for Section 6.3 317
6.4 The Node Template Class 317
Functions That Return a Reference Type 318
What Happens When a Reference Return Value Is Copied Elsewhere 320
The Data Member Function Now Requires Two Versions 320
Header and Implementation Files for the New Node 321
Self-Test Exercises for Section 6.4 321
6.5 An Iterator for Linked Lists 328
The Node Iterator 328
The Node Iterator Is Derived from std::iterator 330
Pitfall: std::iterator Might Not Exist 331
The Node Iterator’s Private Member Variable 331
Node Iterator—Constructor 331
Node Iterator—the * Operator 331
Node Iterator—Two Versions of the ++ Operator 332
Programming Tip: ++p Is More Efficient Than p++ 334
Iterators for Constant Collections 334
Programming Tip: When to Use a Const Iterator 336
Self-Test Exercises for Section 6.5 336
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Exploring the Variety of Random
Documents with Different Content
“Yes, I was very tired,” she acknowledged. “I have done nothing but run
about, and then wait, which was still worse. And then—” She sat up
suddenly throwing off her coverings. “James! you know—how did you
know?”
“Tell me first,” he said. “It is very little I know—and then I will tell
you.”
“That is a bargain,” she answered smiling, and then with many
interruptions of remark and commentary, she told him her story: Rankin’s
hint, and Marion’s first of all.
“Marion! Marion told you that?” he cried in amazement.
“She told me nothing. I do not for a moment suppose that she knew
anything,” cried Evelyn, scenting another danger, “but she is very keen-
witted, and must have felt that if there was a mystery—”
“A great deal too keen-witted, the little—” The substantive intended to
come in here was a profane one, and Rowland felt on his side a danger too.
“And then I had all the trouble in the world to see him. I almost forced
an entrance at last, and by the threat of invading him in his own room—
indeed,” said Evelyn, “it was not a threat only, I should have gone to his
room, as I could find him no other where. But the threat sufficed and he
came. James! the boy has committed a great crime, but oh my heart is sore
for Eddy. He has no mother.”
“You think you might have been his mother, Evelyn?”
“I don’t know how you should have divined it—but I do: thank God that
I am not! but sometimes I cannot help thinking what a terrible fate I might
have had, but for the goodness of God—”
“Working through the wickedness of man.”
“Don’t raise such questions, James! Don’t make me think of it at all. I
have been spared that fate, thank God, and saved for a very different one. It
is very fantastic, but it gives me a feeling to the children—”
She had put out her hand to him, and he held it in his own. He gave it a
grip, now, more loving than tender. “It gives me,” he said, “a feeling too.”
“Not of—dislike—not of——”
“What do you take me for, Evelyn? A man like me is often very
fantastic, I allow, though nobody would think it. I am so touched by the
thought that they might have been your children, and so glad of the escape
we have had that they aren’t; and so sorry for them, poor things, for losing
the best chance they could have had.”
At this curiously mixed statement of what was so real and true to the
speakers, Evelyn laughed, with tears in her voice, pressing her husband’s
hand. And then she said, “Now tell me, James, how you know?”
This was not so easy as her task. The middle-aged man of business
blushed as youths and maidens are alone considered capable of doing. “Is it
not enough that I might have guessed like Marion, or that Marion might
have communicated her guess to me?”
“Anything is enough that you tell me,” she said.
“That drives all fiction out of my mouth. The reason I knew, Evelyn, was
that I was there.”
“There!” she cried in amazement, raising herself upright.
“There! more or less. I thought you must have seen me when you came
out as you did, with a bounce, not like you. I was, I am ashamed to tell you,
like a wretched spy, on the other side of the road, watching where you had
gone.”
She turned her face to him with such a look of wide-eyed astonishment
that his countenance fell. “I have to beg your pardon, Evelyn. Hear my
story first, and then you can say what you please. I was just wild with
disappointment and misery when I found you gone. Then—it was on a hint
—I guessed where you were. I got up to London on Friday morning—was it
only yesterday?—and they told me at the hotel you had just gone out, that if
I followed you—. I did follow you, and came up to you. But I couldn’t
speak to you. How could I ask an account from my wife of where she was
going, or tell her I had followed her? I just followed still, and then I saw
that you went in, and guessed that you had an interview upstairs, and then
an interview downstairs. And then—Well, when we both got back to the
hotel I was more certain than ever that I could not show that I was spying
upon you, Evelyn, and was ashamed even to say that I wondered what you
were doing. I knew whose house it was, by instinct I suppose. And then,
Eddy came to you in the afternoon. And I could think of nothing else but
that—when I thought you had been occupied about my boy, it was this
other boy that was filling your mind. And then you came back, and I with
you in the next carriage, though you never saw me. And then to my wonder
and astonishment I watched you come here. So that when you said you had
seen the man who—committed that forgery—I knew at once who it was.”
Rowland concluded his narrative with his head bent down, the words
coming slowly from his lips. He did not meet the eyes which he felt sure
must be full of wrath, and every moment he feared that the hand which held
his (his own had become too limp with alarm to hold anything) should drop
it, or fling it away in indignation. Evelyn held it tight, giving it a fierce little
pressure from time to time. No doubt presently she would fling it from her.
And there was a silence which was awful to the penitent.
“I never,” she said at last, “could have recognised you in the rôle of a
detective, James.”
“No,” he said, with a furtive glance at her, slightly encouraged by the
sound of her voice, though doubtful that the tightness with which she held
his hand was preliminary to the sudden tossing away from her, which he
expected and feared. “No, it is not exactly my kind of way.”
“But I recognise you,” she said, “very well, when you were not able to
say to your wife that you suspected her, when you were ashamed to let me
know that you wondered what I was doing. Of what did you suspect me,
James?”
She did not loose his hand, but he freed it unconsciously, rising to his
feet in overwhelming agitation at this question. Of what did he suspect her?
Good heavens! Rowland’s forehead grew cold and wet, his eyes rose,
troubled, to meet those with which she was regarding him—large, clear,
wide open. It was cruel of Evelyn: the man was so intimidated that he could
scarcely reply, though indeed he had been all the time dans son droit.
“I—did not suspect you of anything. Tut!” he said, recovering himself,
“why shouldn’t I say the worst? I suspected you of going to consult that
man about your husband’s affairs.”
“Did you indeed, James? You supposed I was going to consult a man—
of whom I have a right to think everything that is worst in a woman’s eyes,
whom I neither trust, nor esteem, nor believe a word that he says—upon the
concerns of my honourable husband, which are my concerns, and more than
mine, just so much more than mine that I am trusted with them? You could
suppose that, James?”
“No,” said the unfortunate man, moving from one leg to the other in the
extremity of his perplexity and distress. “No, you’re right, Evelyn, I didn’t.
I suspected nothing. I was ashamed, bitterly ashamed of the whole affair. It
was nothing but the suggestion of that little—I mean it was the madness of
my disappointment at finding you not there. What I meant to say,” he
added, taking a little courage, “was that perhaps if it had been anybody but
you—”
“No,” she said. “No sophistry, James: whoever it had been, it would
have been the same thing. You would have been ashamed to ask an honest
woman any such question. You are not the kind of man to believe in any
shameful thing. Most men believe in every shameful thing—that man, for
instance, whom you thought I was going to consult.”
He hung his head a little under this taunt, but then he said in a certain
self-justificatory tone, “You saw him after all.”
“I saw him,” she said, a slight flush for the first time rising on her face,
“against my will. I was not aware he was there. I had heard from Rosamond
that he was still abroad: not that I mean you to think,” she added at once,
“that it would have made the least difference had I known he was there. I
should have gone—to throw light upon this trouble—anywhere in the world
—had the devil himself and not Edward Saumarez been there. I don’t know
which is the worst,” she said impulsively. “I think the other one’s perhaps
belied, but not he.”
Evelyn’s strong speech made her falter for a moment and be silent,
which encouraged Rowland to say, putting out his hand again, “Devil he
may be, but I’m cutting a poor enough figure. Do you think you will be able
to forgive me, Evelyn? I will never do it again.”
The rueful humility of the tone restored Mrs. Rowland to herself. She
laughed putting her hand in his. “Yes, do it again,” she said, “for there never
was anything so delightful in the world as a man who follows his wife off to
London, where she is perhaps going astray, and is ashamed to ask her what
she is doing when he finds her there. You make me proud of my Othello: for
he is quite a new one, better than Shakespeare’s. Oh, James! what a
difference, what a difference! To think you should both be men of the same
race, that hideous satyr, and you!”
To say that good James Rowland had any very clear idea what she was
raving about would be untrue. He knew no resemblance he could possibly
have to Othello, nor what Shakespeare had to do with it. Neither was he
clear who was the hideous satyr. But he knew that this trust on Evelyn’s part
was to his own credit and praise, and he was pleased, as the best of men
may be.
“Well,” he said, recovering himself entirely, “we will consider that
incident over, Evelyn, and me the most happy man in Scotland, be the other
who he may. I owe Archie some amends for suspecting him, but you will
allow—”
“I will allow nothing,” said Evelyn. “Had you treated him as you treat
me, and been ashamed to suggest such a thing to your son as you own you
were to your wife, we might all have been spared a great deal of pain. But
now it’s all over, thank God, and you will know better another time.”
“Don’t fall upon me and slay me on another ground after you’ve
forgiven me on your own,” he said. And then he grew suddenly grave and
asked, “Did he give you any details—did he tell you why he did it, the
unhappy boy?”
“He asked me only that the cheque might be destroyed. I thought you
would think Archie’s exculpation cheaply purchased at that cost.”
“Of course, of course,” he said with a wave of his hand.
“And gave me this, which he said would to you be proof enough.”
Mr. Rowland took the scrap of paper, with his own name written upon it,
in different degrees of perfection. He looked at it intently for a minute, then
threw it into the smouldering fire, where it made a momentary blaze and
flickered away.
“If the thing could be destroyed like that!” he said. Then after a pause,
“The question is, what is to be done with that unhappy boy.”
“James! I promised him exemption, safety. He was never to hear of it
again.”
“Tut, tut!” he said. “It’s you now, Evelyn, that shows a want of
understanding. Do you think anything in the world would make me bring to
disgrace and ruin that boy! The creature’s not of age,” he cried. “What are
we to do with him, to make it still possible that he should live his life?”
“James,” cried Evelyn, after a pause, “I must tell you. There are such
curious differences. I don’t think that Eddy is—very unhappy. He has his
moments of seriousness, but generally he takes it lightly enough.”
“I don’t see that that makes it any better. Are we to leave him among his
debts and his follies, to be tempted to do such a thing again? He should be
separated from that horrible,—what do you call it—society life of his, and
set to work.”
“I don’t think you would ever get him to work, James!”
“He should be taken, anyhow, out of that whirl of wretched life.”
“He could not live out of it, James!”
“Yet he managed to exist for a whole month at Rosmore.”
“Oh, my dear James, he was born in it, and he will die in it. He could not
manage to exist out of that atmosphere of society.”
“I have a great mind to try,” Rowland said, walking about the room.
“What is the good of saving a man from drowning with one hand, if ye
pitch him back into the water with the other? I like radical measures. I
would send him right away to some sort of work.”
She said nothing but shook her head.
“By George, I will try!” cried her husband, “if you were to shake your
head off, my dear. I won’t let the laddie perish without a try to save him.
He’s saved me, and the peace of my house. You may say he put it in
jeopardy first: but it took some pluck, Evelyn, to put that, and his life, so to
speak, in your hands. He must have good meanings in him. I will send for
the lad—I will—”
“I must tell you something first, James, and then you shall act as you
please. He said to me, ‘This means that I shall never see any of you again.
And I was fond of little Marion—though she doesn’t deserve it any more
than I do.’ It was a curious thing to say.”
Rowland gave a long whistle, and a twinkle of fun arose in his eye. “She
doesn’t deserve it any more than he does!” he said. The speech did not
make him angry, as Evelyn had feared. It made him laugh, and his laugh
was not ungenial. “By Jove!” he said to himself: but he did not explain to
Evelyn the idea which was veiled by that exclamation. There was, indeed,
no need that there should be any meaning at all.
CHAPTER XLVII.
The return of the united family to Rosmore was, it is scarcely necessary to
say, scrutinised by many keen and eager eyes, all aware that there had been
something wrong, all, or almost all, glad to see that the something had so
soon come to nothing. Except that Archie was exceptionally shabby in his
old clothes, and that he was deeply conscious of this fact, and accordingly
kept as much as possible in the background, there was nothing to show that
the party was anything more than the most ordinary party returning from
some joint expedition. The people in the steamboat, however, allowed their
knowledge to be revealed by effusive and unnecessary expressions of
satisfaction in the return of Mr. Rowland and his wife and son, which were
quite uncalled for, in view of the fact that neither of the former had been
gone for more than a few days. “I can scarcely express to you the
satisfaction I feel in seeing you back,” the minister said, with a significant
grip of his wealthy parishioner’s hand; and Miss Eliza, who happened to be
coming by the same boat, fell upon Evelyn with a shriek of joy. “I’ve not
seen so delightful a sight for years as the sight of your bonny face, with all
your belongings round you,” Miss Eliza said, holding out her left hand and
a beaming smile to Archie. These signs of popular satisfaction were
received by Mrs. Rowland not exactly with offence, but a little coldly, in
view of the fact that nobody had any right, even by inference, to remark
upon what was so entirely a family matter. But her husband, who was in
great spirits, and inclined to make friends with all the world, received these
effusive salutations with pleasure, and without enquiring how much they
knew of the circumstances which made this home-coming remarkable. He
was perhaps more used to the warmth of Scotch neighbours, and understood
it better. At the pier the two girls were waiting, both of them curious and a
little excited. Marion’s eyes were glittering like beads with a desire to
know, and Rosamond, though she held up her head with her accustomed
calm, and repressed all consciousness of anything unusual, betrayed in a
slight dilation of her nostril, and momentary quiver of her lip, her share of
the general excitement. She slipped aside from the carriage in order to leave
the family undisturbed in their reunion, which was indeed a thing very little
desired by any of its members: but was joined by Archie before she had
gone far. He was too glad to escape from the sensation of the prodigal’s
return, although more and more conscious of what he felt to be the chief
feature about him—his exceedingly shabby coat.
“I am glad you have come home,” said Rosamond.
“So am I, more or less,” said Archie.
“I suppose you like the freedom of being away. But the more you are
free to go, the more endurable the dullness should be. When one knows one
can get quit of it at any moment, one does not mind.”
“I was not thinking of the dullness,” said Archie; “it has been the other
way round with me. I suppose it’s contradiction. When you are shut out
from your home, you take a longing for it. It’s through your brother
somehow, I can’t tell how, that I’ve come back now.”
“Through Eddy!”
“I don’t know how; he has cleared up something. It is queer, isn’t it,”
said Archie, with a laugh, “that a little beggar like that—I beg your pardon,
Miss Saumarez, I forgot for the moment——”
“It is true enough,” said Rosamond, gravely. “He must look a little
beggar to you. I beg to remark, however, Mr. Rowland, that you are not
yourself very tall, nor perhaps of a commanding aspect, by nature.”
Archie could not accept this jibe as Eddy would have done. He grew
graver still than Rosamond and became crimson. “It’s just a silly phrase,”
he said, “that means nothing. Eddy’s far more commanding, as you say,
than I am. I know the difference well enough: but it’s a little hard all the
same to think that a man’s own father should take the word of a stranger
rather than——”
“Oh, do you think there’s anything in that?” said Rosamond. “I don’t: in
the first place, if you must speak for yourself, you’re a prejudiced witness,
that’s what they say. And again, you know a man’s father—or a woman’s
father either, for that matter—does always believe other people sooner than
you. It has something to do with the constitution of human nature, I
suppose,” she added with philosophical calm. “And then, perhaps, if you
will allow me to say it, Eddy might know more than you.”
“About myself?” said Archie.
“About other people. Eddy knows a great deal about some kinds of life. I
don’t say it is the best kinds. He knows the ways of a bad set. So that if it
was anything wrong, he might be able to throw a light—It is a pity, but that
is the turn he has taken,” said Rosamond. “He seems to find scamps more
amusing than others. Perhaps they are, for anything I know. I have thought
myself, that if you didn’t mind about being respectable and that sort of
thing, which of course a girl must mind, that it might be perhaps more
amusing. One never knows. Certainly society men are not amusing at all.”
“I should have thought,” said Archie, “you would have liked them best.”
“No,” said Rosamond dubiously, “the worst is, people are so hideously
like each other. That’s why one longs after what’s disreputable or—
anything out of the way. One hopes to light upon a new species somewhere.
So far as I can see, however,” she added, “Eddy’s people are just as dull as
the rest.”
Archie was quite unable to keep up the ball of this conversation. It
flustered and made him uncomfortable. He was very certain that whatever
could be said for himself (and he did not think that much could be said for
him), nobody would venture to assert that he was amusing.
“I should have thought,” he said hesitating, “that a fellow you could trust
to, that was of the kind that would never fail you whatever you wanted, and
thought more of you a great deal than of himself, however awkward he
might be, or uncouth, or that—”
“Oh,” said Rosamond, “if it’s moral qualities you are thinking of, the
best thing perhaps to do would be to pick up the nearest curate and make a
model of him.” Which perplexed Archie more and more: for though he
knew little of curates, he had been brought up with a wholesome respect for
the minister, yet did not perhaps think that dignitary exactly the person “to
please a damsel’s eye.” He expressed the difficulty he had in carrying on the
conversation by a hesitating and puzzled “O-oh!” but said little more. And
those young persons walked the rest of the way to Rosmore in partial
silence, broken by an occasional monologue from Rosamond, who did not
dislike a good listener. And there is no doubt that Archie was admirable in
this way.
The rest of the party were less happy, for it must be said, that though the
conversation did not flourish, there was to Archie, and possibly also, more
or less sympathetically, to Rosamond, a sort of vague pleasure in moving
along by the side of a person so interesting, which, though quite vague, was
wonderfully seductive, and made the woodland roads into enchanted ways,
and gave every moment wings. The lad found himself in a charmed
atmosphere when he was by her side. During the tremendous internal
conflict through which he had passed, he had thought of Rosamond, not
according to her own formula, as amusing, but as the opposite extreme to
that lowest kind of existence, the highest point of interest, variety and
stimulation, which life contained. And now he had stepped at once from the
depths to the height. He did not mind what it was she was saying, nor even
that he could not reply to her. As he walked along by her side, Archie was
buoyed up as by heavenly airs. He trod not on common earth, but on
something elastic and inspiring that made every step light. And though
Rosamond would have been greatly surprised had she been accused of any
such feeling for Archie, yet perhaps the sympathy of the exquisite elation in
his being affected her more than she knew. But, as has been said, the rest of
the party were less happy. Marion sat with her back to the horses, partly
from choice, in order to have the others more at her mercy, and partly in
supposed deference to Rowland, who liked to have his face turned in the
direction in which he was going like many other energetic persons. She
surveyed her father and his wife as from an eminence, commanding every
look and movement. There is not a better point of vantage than the front
seat of a carriage when you mean to cross-examine and reduce to
helplessness the people opposite to you, who cannot escape.
“I am very glad, papa,” said Marion, “that you have got over your little
tiff, and all come so nice and friendly home. I knew quite well that you and
mamma would very soon make it up, but I was very anxious about Archie,
who is a different question. And have you got any light about that cheque,
or is it just the father falling on his neck, and the prodigal coming home?”
“The cheque?” said Rowland, in a low tone of astonishment, with an
anxious glance at his wife.
“Oh, yes,” said Marion, in her clear notes, “you need not speak low,
papa, as if that would do any good: for everybody knows just quite well
what it all was about.”
“You seem to know more than I do, Marion,” said Rowland; “therefore,
perhaps, you will be good enough to expound the matter to those, who have
given you the information, in your own way.”
“Yes, papa,” said Marion, with charming docility: “but I could do that
better,” she added, “if you would answer my question: for if it’s just your
kindness, like the man in the parable, that’s one thing: but if it’s cleared up,
that’s another—and I would like to know.”
“I am sure it will please Marion, James,” said Mrs. Rowland, “to be
assured that it has been cleared up, and that both her hints to me and to you
have been of use. I am not sure,” she said, with a laugh, “that Eddy was
very grateful to you for suggesting that he would know.”
“Oh, you told him it was me!” said Marion. Her eyes, which were
dancing in their sockets with curiosity and excitement, were clouded for a
moment. “Well!” she said, after a pause, “I am not minding. It was quite
true.” She put her hand on Mrs. Rowland’s knee, and leant forward eagerly.
“Was it yon man?” she asked.
“What have you to do with it,” cried her father, “you little——! You
never lifted a finger for your brother, so far as I know.”
“It would not have been becoming,” said Marion, with dignity, “if I had
put myself forward. And how did I know that you would have liked it,
papa? I just was determined that I would not commit myself: for if he had
never come back it would always have been a comfort to you that you had
one that made no fuss. But when mamma consulted me, I gave her the best
advice I could, and when you consulted me, I just told you what I thought.
And it appears,” said Marion, taking them in with an expressive glance,
“that it has all been for the best.”
“It has been entirely for the best,” said Evelyn, “and you could not have
done better for us if you had meant it.” Mrs. Rowland was but a woman,
and she did not forgive her stepdaughter for the suggestion which had cost
her husband so many troubled hours. They drew up to the door at this
moment to the general relief, but Evelyn could not refrain from a final
arrow. “You will be glad to know that nobody has come to any harm,” she
said.
But Marion was not sensitive to that amiable dart. She clutched her
stepmother’s dress to hold her back. “Was it yon man?” she said, “and did
he get clear away after all?”
Evelyn stepped quickly out of the carriage and made no reply; but, as it
happened, Marion’s unanswered question was of the greatest importance
and advantage to the anxious household and deeply interested country-side.
For, dropping into Saunders’ thirsty ears, like the proverbial water in the
desert, it was by him shaped into the most satisfactory of conclusions to the
much debated story. “It was that fellow in the bad coat,” he said, in the
housekeeper’s room, as soon as he had superintended the taking in of tea. “I
knew yon was the man.” Saunders was a little breathless, being a portly
person, and having hurried in at the top of his speed to convey the news. “I
must say Miss Marion has a great consideration for us in the other part of
the house,” he added. “She asked the question just as I stood there, though I
make no doubt she had ‘ad it all out afore that.” Mr. Saunders was a
Scotsman by birth, but he had been in the best families, and slipped an h
now and then just to show that he knew as well as any one how fine English
was spoke.
And the news ran far and wide—to Rankin’s cottage, and to the Manse,
and up the loch to the innumerable neighbours who had taken the
profoundest interest in the story. A great many people, it turned out, had
seen “yon man.” He had been observed on the lochside walking back with
an ulster that was much too big for him, covering his badly-made evening
coat. And all the inhabitants of the little cluster of cottages in one of which
he had lived, had given Johnson up as the malefactor long ago—for had he
not come in from the ball in the middle of the night, and thrown his things
into his bag, and struggled off again in the ulster which was not his, over
the hill to Kilrossie before it was light? At the head of the loch there was the
most unfeigned satisfaction that it had proved to be “yon man.” And Archie
was the subject of one prolonged ovation wherever he appeared. “I am as
glad to see you back as if I had gotten a legacy,” Miss Eliza said, patting
him on the back. “When I thought of the noise we were all making that
night of the ball, and you, poor lad, with such trouble hanging over you, and
nobody to know! But it’s all blown over now, and justice done, the Lord be
praised.” The reader, better informed, knows that poor Johnson had met
with anything but justice, but the opinion of the loch had happily no effect
upon his equanimity, and indeed, if it could have been supposed to have had
any effect, no doubt he deserved all the obloquy for something else, if not
for that.
And it surprised nobody when Eddy Saumarez arrived one evening to
finish his visit, as was said—that visit having been painfully cut short by
the family trouble and false accusation of Archie, which his friend had been
too sensitive to bear. Eddy had been a general favourite, and everybody was
glad to see him, even Rankin, who received him very graciously, though
with a flush upon his face, probably caused by too hot a fire. “I could
accommodate you now with a puppy, if you were still in want of one,”
Rankin said, fishing up a sprawling specimen of the Roy section from that
nest in which he kept his nurslings warm; and he added, “I’m real glad to
see you without yon spark. Ye’ll learn anither time not to try to get your fun
out o’ me with a ficteetious philosopher: for I wadna be worth my salt as a
philologist, not to say an observer o’ human nature, if I didna see through an
ill-spoken ignoramus like yon.”
“Everybody is not like you, Rankin,” said Eddy; “all the rest swallowed
him like gospel.”
“It is true,” said Rankin, “that everybody is no like me. I have maybe
had advantages that are not of a common kind; but ye shouldna abuse the
confidence o’ the weaker vessels. And ye never can tell at what corner ye
may fall in with a man that is enlightened and that will see through your
devices—at least in this country. I’m tauld there’s far less advanced
intelligence in Southland pairts. Ay, that’s a fine little beast. I havena had a
better since the one that went to the Princess, ye will maybe have heard o’
that—a real beauty, but he wasna appreciated. I hope you have mair sense
than ever to have such a thing said of you.”
Thus Eddy’s absolution was sealed by his very accuser, and his
reputation vindicated.
The scene in Rowland’s study was perhaps more difficult to get through.
It was in answer to a telegram sent from Glasgow that Eddy, with some
excitement, made up his mind to return to Rosmore. “Come and finish visit.
Have much to say to you,” was Rowland’s message, which set Eddy’s
pulses beating. For a moment a horrible thought gleamed through his mind
that his confession was to be used against him, but this he soon dismissed as
impossible. It was bad enough without that, and demanded an amount of
courage which Eddy, though full of that quality, scarcely felt that he
possessed. He was dumb when he found himself at last in the dreaded room
where Archie had suffered for his fault. Eddy was a trifler born, and had the
habit of taking everything lightly; his most tragic moment came between
two jests—he could not have been serious for five minutes to save his life.
But when he was ushered into Rowland’s room, and found himself face to
face with the man whose name he had forged, whose money he had
appropriated, whose heart, tough and middle-aged as it was, he had nearly
broken, Eddy had not a word to say. He stood dumb before the judge who
had voluntarily laid aside all power to punish him. Something rose in his
throat which took away his voice. He could not have spoken had all the
hopes of his life depended upon it. Happily this inability to articulate had
more effect upon Rowland than the most voluble excuses could have had.
“Eddy,” he said, “I’ve sent for you, thinking I had a right. I have a
grievance against you, and then, again, I have received a favour at your
hands.”
Eddy made a gesture of deprecation, and tried to utter something, but
could not.
“Yes,” said Rowland, gravely; “I’m not a man to make little of what you
did. But when you put your life in my wife’s hands to save my son, you did
me a greater service than any other man on earth could do: and you did in
the circumstances all that a man could do.”
“It’s not capital now, sir,” said Eddy, finding his voice as his spirit began
to come back to him.
“No, it’s not hanging,” said Rowland, with a slight smile; “but it’s ruin
all the same. Now, look here.” He took the cheque from the envelope in
which he had put it away, “and here.” He took from his pocket-book the
guilty scrap of paper which Eddy had given to Evelyn. “Put these in the
fire, and destroy them, and then we can talk.”
Eddy did what he was told with what scrupulous care it is unnecessary to
describe, and poked the very films of the burned paper into the bottom of
the fire. Then he turned to Mr. Rowland, his face reddened with the blaze,
his eyes hot and scorched, his features working. He took the rich man’s
hand and held it fast between his. “Tell me to do anything in the world,” he
said, “whatever you please, and I’ll do it. I am your bond-slave, and will not
call my soul my own unless you say I may.”
“Sit down, boy, and don’t talk nonsense,” said Rowland, himself
considerably moved. “I am going to tell you to do several things, and I hope
you will obey. But first, Eddy, if you were in such a terrible scrape, why
were you such a little fool, when you had a man like me close at hand, not
to come and ask for it. Would not that have been the wise way?”
“It would have been a very cheeky thing to do to come and ask a man,
because he’s been kind to you, to give you a th—though, of course,” Eddy
interrupted himself, in a low voice, “less might have done then.”
“A cheeky thing is better than a bad thing,” said Rowland sententiously.
“Perhaps I might have been surprised: but now, my lad, let us get to the
bottom of all this. If I take you in hand, I’ll have no half measures. How
much do you want to clear you altogether, so that you shall be your own
master when you come into your estate?”
“To clear me?” Eddy’s eyebrows went up altogether into his hair. “Well,
sir,” he said, “that is a confusing question, for, you see, unlimited tick, that
is to say, credit——”
“Don’t be a humbug, Eddy!”
“Well, I suppose you know what tick means,” the young man said, with a
laugh, “not unlimited, by any means; though, to tell the truth, except for—
I’m very nearly cleared.”
“Very nearly won’t do for me, neither will I have any exceptions; put
them all down, every one, without any exceptions, and bring them to me.
I’ll see you cleared: and now for what I want you to do.”
“Yes, sir,” said Eddy, putting his hands by his side with the air of a
docile little schoolboy eager to obey.
It was all Rowland could do not to laugh, but he was scandalised at
himself for his levity, and forbore.
“There is a choice of two or three things,” said Rowland. “You might go
out to my overseer in India, and try what you can do on the railways. There
is nothing succeeds so well there as a man who knows how to manage
men.”
Eddy produced a little sickly smile, but he did not make any response.
“Or you might try ranching out in Canada or the Wild West: or the same
kind of thing, though they only call it stock-keeping, in Australia: or—— It
really does not matter what it is, if it’s good hard work. I make a stand upon
that. Good, hard work,” said Mr. Rowland; “it’s the way of salvation for
you spendthrift young men.”
“Yes, sir,” said Eddy again, with his schoolboy air, but in rueful tones.
“Man alive!” cried Rowland, “can’t you see what a grand thing it would
be for you? your thoughts taken off all your follies and vanities, your hands
full of something wholesome to do, yourself removed out of the way of
temptation. What could you desire more?”
“Ah!” said Eddy, “I’m afraid I’d desire a different body and a different
soul, only such trifles as these. I’m a product of corrupt civilization, I am
not the thing that lives and thrives that way. Probably out there I should
gravitate to a gambling saloon or a drinking bar.”
“You don’t drink, Eddy?” cried Rowland, with an alarmed countenance.
“No, I don’t drink—not now,” said Eddy, with sudden gravity; “but what
I might do after six months of a cowboy’s life I don’t know.”
Rowland looked at him for some time with a baffled air. Then he tried
his last coup. “My wife told me,” he said—“I hope she did not betray your
confidence—that there was something about Marion.”
A sudden flush of colour went over Eddy’s face, and he began to move
his foot nervously, as he did when he was excited.
“And that you had,” Rowland said, with an inflection of laughter in his
voice not to be concealed, “a very just appreciation of her. Now, my man,
without some such probation there could be no thought of my daughter, you
must know.”
Eddy sat with his head bent, swinging his foot, and for a moment made
no reply. At last he said, “How long, sir, do you mean the probation to last?”
“Let us say at a venture three years.”
“Three years!” said Eddy, with comic despair. “Mr. Rowland, I am very
fond of Marion, though—and I shouldn’t wonder if she could fancy me. She
has a poor opinion of me, but that needn’t matter. We could always get on
together. But do you think, from what you know, that if somebody with a
handle to his name turned up after the drawing-room, that Marion would
wait for me out ranching in California for three years?”
In spite of himself, Rowland laughed. “I never could take upon myself to
say, Eddy, what love might do.”
“No?” said Eddy, with his head on one side, and a look of interrogation.
“I think I could take it upon myself,” he added. “We might be very fond of
each other: and I, of course, would be out of the way of temptation out
there; besides, I’m not the kind of man that falls much in love. But Marion:
excuse me for talking so freely, sir, but you’ve put it to me. I should find
Marion Lady Something-or-other, when I came back at the end of my three
years.”
“Then you don’t think it worth your while?” Rowland said.
“I did not say that: whatever you say is worth the while. I’ll go if you
press it; and if I don’t come back at all, it will be the less matter. But if you
ask me, sir, frankly, I don’t think it’s good enough so far as Marion is
concerned. She would never wait for a fellow out ranching. I don’t see why
she should, for my part.”
“You are a cool loon,” said Rowland, half offended. “Perhaps you do not
wish she should.”
“Well, she wouldn’t like it,” said Eddy. “I can’t help thinking of her as
well as of myself. She’d take the young Duke, if he turned up, in any case.
There isn’t an eligible young Duke, I believe, now,” he said thoughtfully,
“but the next best. And she wouldn’t wait three years for me, oh no, though
she might like me well enough. The three years system would make an end
of that. I am very much obliged to you for holding out the chance; and I’ll
take your advice for myself, Mr. Rowland, and go—wherever you decide.
But we’re bound to think what’s best for her first, don’t you see? And I
couldn’t give my consent to asking her to wait for three years. Dear me, no!
not for me, as if I were a great catch or good for anything. It would scarcely
be worth her while to stoop and pick me up if I were lying in her road. Why
should she wait three years for me?”
“Eddy, you are a very queer fellow,” said Rowland; “I don’t know what
to make of you. Tell me, now, if you were left entirely to yourself, what
would you like to do.”
“I!” he said. Eddy swung his foot more and more, and sat reflecting for a
minute or two. Then he burst into a laugh. “I suppose she enjoys her life as
much as we do,” he said, “poor old soul! I was going to say there’s an old
aunt of the governor’s, that must die sometime. If she would be so obliging
as to do it now, and leave me her money, as she says she means to!—Then
the governor would hand me over Gilston, which he hates, and Marion and
I—But it’s all absurdity and a dream. The old aunt won’t die, why should
she? and we—why there’s no we, that’s the best of it! and we are discussing
a thing that will never be.”
Rowland walked about the room from end to end, as he sometimes did
when he was forming a resolution. “So you think there’s nothing but
Gilston for you, Eddy?” he said.
“I should be out of harm’s way,” said the lad, “and a place to fill—it
might answer, but again it might not. But why should my old aunt die to
please me? or Marion give up her Duke—or you take all this trouble—I am
not worth it,” Eddy said.
CHAPTER XLVIII.
“You put Mrs. Rowland on my traces,” said Eddy; “why did you do so, you
little witch? Wait till I find out some bad trick I can play you.”
“It has all turned out very well,” said Marion sedately. “I am not at all
sorry I did it. I knew that man was about something wrong. And you should
not know such people, Mr. Saumarez. I was bound to tell them anything I
knew.”
“Miss Rowland,” said Eddy, “your father is going to pay all my debts,
and send me out to California, or somewhere, to a ranch, to expiate all my
sins; and when I come back in three years or so, as a reward, if you are not
the Duchess of So-and-so, we may, if we please, marry.”
“Who may marry?” said Marion astonished.
“The only people whom I know who really suit each other,” said Eddy
calmly. “You and I.”
“You and—me,” cried Marion in great wrath. “You are just very
impudent to say so. Me marry you!—without ever being asked—without a
word! In three years or so! I just tell you I will do nothing of the kind.”
“That is exactly what I said. I said, if you think Marion will wait three
years for me! She will take the first Duke that offers, and she will be one of
the ornaments of Queen Victoria’s court long before I come home.”
“I was not saying exactly that,” said Marion. “Where am I to get the
Duke? There are none but old bald-headed men.”
“An Earl then,” said Eddy. “There are always lively young Earls or
Viscounts in hand, more to be counted on than plain Eddy Saumarez, who is
nobody. That’s what I said to your father, Miss May. Why should you wait
for me? I told him I saw no reason.”
“Especially when I was never asked,” Marion said.
“Yes,” said Eddy. “You see how good I am at bottom, after all that has
happened. I said I would play you a nasty trick if I could find one, but I
haven’t. You should be grateful to me. I haven’t asked you—so far as words
go.”
“I don’t know,” said Marion with a little quiver in her lip, “how a person
can be asked except in words.”
“Don’t you?” he said, and then they gave each other a look, and burst
into mutual laughter, of the emotional kind.
They were walking down the slope of the bank towards the Clyde, under
trees now bare with the surly winds of winter. It was a dull November
afternoon, and everything was done in tints of grey; the skies in long bands,
here darker, there lighter, as the vapours were more or less heavy, the
opposite shore a tinge more solid than the long weltering line of the water
which had the ghost of a reflection in it, the points standing out like black
specks upon the grey, the wreaths of smoke half-suspended in the still air
over the town of Clydeside, putting in an intermediate tone between the
two. The edge of the great stream grew a little lighter as it crept to their feet
over the shallows, and broke on the beach with a faint white line of foam.
“I will always maintain,” said Eddy, “that there never were two people
so fit to go together as you and I. We haven’t any wild admiration of each
other; we know each other’s deficiencies exactly; we don’t go in for
perfection, do we? But we suit, my little May, we suit down to the ground.
You would know what you had to expect in me, and I could keep you in
order.”
“You are just very impudent,” she said. “I never gave you any
encouragement, Mr. Saumarez, to think that I was willing to be—to do—I
mean anything of that kind.”
“Ah, Marion,” he said, “you may be as stern as you like, but I know I
would suit you better than that duke. You would get dreadfully tired of
being called your grace, and having him, a stupid fellow, always stuck there
opposite to you; but you would not get tired of me.”
“How do you know that? I am often just very tired of you,” said Marion.
“You think too much of yourself. We would not agree, not for two days
without a fight.”
“That is just what I say. There would be no gêne between us, we know
each other so well. Don’t you think, after all, you would perhaps wait for
me, Marion, supposing the duke did not come? I never could pretend to
stand against him. Say you will, and I’ll do what your father says, and go
ranching: though most likely I shall break my neck the first year, and then
you will be free of your promise, May.”
“Why should you go ranching, as you call it, and what does it mean?”
“That’s what I don’t know. It means riding about after cows, but why I
can’t tell you. I know nothing in the world about cows. I scarcely know one
when I see it, but your father thinks it’s the right thing. I’ll go if you’ll wait
for me, May.”
“And what would you do, Eddy,” she said, stealing a little closer to him,
“if you didn’t go?”
“That’s more than I can tell you. But I’ll tell you what I’d do, May, if old
aunt Sarah would only die. I’d settle with the governor about Gilston, and
we’d furbish it up and live there. In the spring we’d have a little turn in
town, and in winter we’d hunt, and have the house full. We should be as
jolly as the day’s long, and nobody to interfere with us. And I promise you,
you’d go out of the room before Mrs. James Rowland, though he is the
great railway man. I could do that for you, Marion, though I couldn’t make
you Her Grace, you know.”
“Oh, be quiet, Eddy! and if your aunt Sarah doesn’t die?”
“Ah, there you pose me, May. I must either go back where the bad boys
go, to town, and sink or swim as I can, and farewell to my pretty Marion; or
else I must go and ranch, or whatever you call it, as your father says.”
“It is strange,” said Marion very seriously, “that old people should make
such a point of going on living, when there are young ones that want their
money so very much—and when they know they have had their day.”
“One may say it is inconsiderate,” said Eddy with a twinkle in his eye,
“but then the thing is, why should she take all that trouble for us? I am sure
we would take none for her: and here we are just back again, Marion, where
the four roads meet—Gilston or California, the ranch or the—devil: that’s
about what it is.”
“You had, perhaps, better go to the ranch, Eddy.”
“And you’ll wait for me, May!”
“Perhaps,” said the girl, with tears which were honest enough, in her
eyes. “If I don’t see somebody I like better,” she added with a laugh.
“Most likely,” said Eddy philosophically, “I shall break my neck the first
year—and then you need not hold to your promise. But don’t marry any one
under the rank of a marquis, for my credit, if you love me, May.”
“Oh, we’ll see about that,” Marion said.
It was after she had come in from this conversation, and had thought it
all over in her own room, and made several calculations, that Marion
walked very sedately downstairs, and knocked at her father’s door. She was
slightly disconcerted when she saw that Mrs. Rowland was with him, but,
having quite distinctly made up her mind what she was going to do, her
confusion was slight and soon passed away. She did not sit down, but stood
by the writing table at which he was seated, leaning her hand upon it, which
was a token that she meant business, and did not intend to waste words.
“Can I speak a word to you, papa?”
“As many as you please,” said Rowland. “Sit down, May; but if you are
coming to ask explanations——”
“Explanations?” she said with some surprise. “Oh, you will perhaps be
meaning about Archie? There is no occasion. I was always very clear about
that; and it was me that gave mamma the first hint, as she will perhaps
mind. I was coming to speak to you, papa, about what may perhaps be my
own affairs.”
“Shall I go away, Marion, and leave you alone with your father?”
“Oh, no, there is no need. You will be better here: for sometimes there
are times when a woman has more sense—I will not beat about the bush.
Why is it, papa, that Mr. Saumarez has to go away?”
“Oh, he has been telling you, has he? And do you mean to wait for him,
Marion?” said her father.
“That is a different question,” said Marion, with a toss of her head,
which was perhaps intended to toss away a little heat that had come to her
cheeks. “I would like to know, in the first place just as his friend, papa,
what end is going to be served by sending him away?”
“And what would your wisdom suggest instead?” said Mr. Rowland.
“The end to be served is to take him away from ill friends and connections,
and make him work—which is the best thing I know——”
“Work!” said Marion with a certain contempt; “and how would Eddy
work that does not know the way? Work is maybe very grand, and I am not
sure but I could do it myself if there was any need. And Archie might
maybe do it. And perhaps it would do him good. But not Eddy; I’ve read in
books about that: if the half of the men out there work, the other half just go
all wrong. Boys are not all alike,” said Marion, with a little wave of her
hand, as if delivering a lecture on the subject; “the boys at the Burn have
that in them that they can just never be quiet—they’re on the hill or out in
the boat, or wrestling and throwing things at each other, if there’s nothing
else to do. But Eddy is not of that kind. He would no more work out there
than he would work here. He will go if you make him, though I can not tell
why he should do what you say. But he will go just helpless, with no use of
his hands, and he will fall into the first net that’s spread for him. Oh, he’s
clever enough!” cried the girl, some angry moisture springing to her eyes;
“he will see it is a net: but he will go into it all the same: for what is he to
do? He has just about as much work in him as Roy and Dhu.”
“Then he’d better disappear off the face of the earth!” cried Rowland
angrily, “with other cumberers of the soil. A man like that has no right to
live.”
“His Maker would maybe know that best,” retorted Marion undismayed;
“and me, I’m willing to take him as he is. But I will not be a consenting
party,” the girl cried raising her voice, “to sending any person away to his
ruin. You think one way is just good for everybody all the same, as if we
were not made dark and fair, and big and little, to show the difference! And
I will not say I will wait for him, papa,” Marion added more calmly, after a
pause for breath. “For I might miss a very good match in the time, and
never get such a chance again; and he might never come back, as I think
most likely, and I would have nobody at all. So I will not promise, for it
would be bad for us both,—both him and me.”
“You little calculating cutty,” cried her father; “is this what you call
being in love with a man?”
“I never said a word on that subject,” said Marion. “I said I was willing
to take him as he is. And I suppose,” she said, coming down suddenly from
her oratorical platform to the calm tone of ordinary affairs, “I suppose you
will be meaning to give me some kind of a fortune, more or less, when I’m
married and go away.”
“I suppose so—to get rid of you,” said her father with a laugh.
“That was just what I meant,” said Marion seriously; “then what would
ail you, papa, to settle about Gilston, and just let him take up the way of
nature there? He could do what was wanted there.”
Rowland sprang from his seat in wrath and high indignation. “Preserve
the game and shoot it in the season, and play your idiotic games all the
summer——”
(“No, papa,” said Marion demurely, “we would be May and June in
town.”)
“And hunt in the winter, and play the fool all the year round—on my
money, that I’ve worked hard for, every penny! I will see him—and you—
far enough first!”
“Papa,” said Marion, “I have been talking to Rosamond upon that
subject, and she thinks that men like you are under a great delusion. For she
says you are not an old man now, but just in your prime, and you’re neither
worn out nor a bit the worse. And she says she knows men that have
worked far far harder and actually have worn themselves out, and never
made any money at all. So that it’s not hard work, as you suppose, but just
that you’re awfully clever, and have had tremendous luck. Oh, you can ask
Rosamond what she means. It is not me; but that’s my opinion too.”
To imagine a man more bewildered than Rowland, thus assailed in his
very stronghold by two “brats of girls,” as he himself said, who could know
nothing about the matter: yet subtly flattered all the same by the statement
that he was still in his prime and awfully clever, things which no man,
especially when he is sur le retour, objects to hear—would have been
impossible. He glared upon his little daughter, standing dauntless, purling
forth her iconoclastic remarks, and then he gave a short laugh, or snort of
angry contempt, and smote her lightly (yet enough to make her shake from
head to foot) on the shoulder, and bade her stick to her own plea and her
lad’s, and let other people speak for themselves.
“Well,” said Marion, “I will just call her in, for she is in the hall, and she
will tell you herself: for I have said my say; and I hope you will think it
over, and come to a better judgment, papa.”
All this time Evelyn had been sitting silent by, supporting her head on
her hand. But, truth to tell, it was not the self-denial of a supporter leaving
her principal to fight for himself, but simple incompetence which silenced
Evelyn. With her head bent down, she had been doing her best to master
and conceal the laughter which was almost too much for her. Mrs. Rowland
was for once on Marion’s side; and the composure of the little girl’s attack,
and its radical character, startled the elder woman. When Rowland sat down
again by her side, with that snort of dissipating and modified fury, she put
her hand upon his arm, and raised her face to him for a moment. And the
good man was more bewildered than ever to see the fun that was dancing in
his wife’s eyes.
“James!” said Evelyn, her laugh bursting forth in spite of her; “she had
you there.”
“The little witch!” cried the bewildered man. He began to laugh too,
though he could scarcely have told why. And then Rowland raised his head
to find quite a different figure standing in front of him in the same position
which Marion had occupied a moment before, but half as tall again as
Marion, with head held high, and a slim, long hand leant upon his table. She
stood like Portia about to make her speech, a simile which, it need not be
said, did not occur to Rowland, but to Evelyn by his side.
“You called me, Mr. Rowland,” Rosamond said.
“You are to tell him,” said Marion’s voice behind, “what you said about
work, Rosamond: for I’m only his own daughter, and he will not listen to it
from me.”
“You little cutty!” Rowland said again, under his breath.
“What did I say about work? it is the thing I wish for most,” said
Rosamond. “As soon as ever I am of age I am going in for it. My father and
people won’t let me now. I do not think they have any right to interfere, but
they do. Mabel Leighton, who is my dearest friend, is going in for
medicine; but I have no distinct turn, I am sorry to say. But we think that
something is certain to turn up.”
“So you are wanting to work, are you, Miss Rosamond? If it had been
your brother, it would have been more to the purpose: for women’s work is
but poorly paid. I never heard yet of one that made a fortune by her own
exertions,” Rowland said.
“A fortune?” said Rosamond. “No, we never thought of that. We thought
we could live on very little, two girls together. And Mabel has something of
her own, and we hoped that grandmamma, as she is all for work, might
make me a small allowance if she saw that I was in earnest. Lodgings are
not dear, if you don’t insist upon a fashionable quarter, and as we shouldn’t
care for meat, or anything expensive in the way of living——”
“Eh?” said Rowland surprised. “And do you think, my dear, you could
make money by saving off your meat?”
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like