0% found this document useful (0 votes)
410 views

C Primer Plus 4th ed Edition Stephen Prata download

C++ Primer Plus, Fourth Edition by Stephen Prata is a comprehensive guide to the ANSI C++ standard, covering essential programming concepts such as loops, functions, and classes, along with object-oriented programming techniques. The book features hundreds of sample programs, exercises, and a friendly tone to facilitate immediate programming practice for beginners. It is designed for both self-learners and classroom use, emphasizing hands-on learning and clear explanations of C++ features.

Uploaded by

erynaaghy49
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
0% found this document useful (0 votes)
410 views

C Primer Plus 4th ed Edition Stephen Prata download

C++ Primer Plus, Fourth Edition by Stephen Prata is a comprehensive guide to the ANSI C++ standard, covering essential programming concepts such as loops, functions, and classes, along with object-oriented programming techniques. The book features hundreds of sample programs, exercises, and a friendly tone to facilitate immediate programming practice for beginners. It is designed for both self-learners and classroom use, emphasizing hands-on learning and clear explanations of C++ features.

Uploaded by

erynaaghy49
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/ 63

C Primer Plus 4th ed Edition Stephen Prata pdf

download

https://ebookname.com/product/c-primer-plus-4th-ed-edition-
stephen-prata/

Get Instant Ebook Downloads – Browse at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Programming in C 4th Edition Stephen G. Kochan

https://ebookname.com/product/programming-in-c-4th-edition-
stephen-g-kochan/

Test Your C Skills 4th Ed 4th Edition Yashavant


Kanetkar

https://ebookname.com/product/test-your-c-skills-4th-ed-4th-
edition-yashavant-kanetkar/

Control valve primer a user s guide 4th ed Edition Hans


D. Baumann

https://ebookname.com/product/control-valve-primer-a-user-s-
guide-4th-ed-edition-hans-d-baumann/

Introduction to Microelectromechanical Microwave


Systems 2nd Edition Hector J. De Los Santos

https://ebookname.com/product/introduction-to-
microelectromechanical-microwave-systems-2nd-edition-hector-j-de-
los-santos/
Spinoza Complete works First Edition Benedictus De
Spinoza

https://ebookname.com/product/spinoza-complete-works-first-
edition-benedictus-de-spinoza/

2G N 63 OFFICE Kersten Geers David Van Severen Spanish


and English Edition Geers

https://ebookname.com/product/2g-n-63-office-kersten-geers-david-
van-severen-spanish-and-english-edition-geers/

RF and Microwave Transmitter Design 1st Edition Andrei


Grebennikov

https://ebookname.com/product/rf-and-microwave-transmitter-
design-1st-edition-andrei-grebennikov/

Kim Ki duk 1st Edition Edition Hye Seung Chung

https://ebookname.com/product/kim-ki-duk-1st-edition-edition-hye-
seung-chung/

Stochastic Claims Reserving Methods in Insurance 1st


Edition Mario V. Wüthrich

https://ebookname.com/product/stochastic-claims-reserving-
methods-in-insurance-1st-edition-mario-v-wuthrich/
Tutankhamen s Curse The Developing History of an
Egyptian King Joyce Tyldesley

https://ebookname.com/product/tutankhamen-s-curse-the-developing-
history-of-an-egyptian-king-joyce-tyldesley/
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks.

C++ Primer Plus, Fourth Edition


By Stephen Prata

Publisher: Sams Publishing


Pub Date: November 14, 2001
ISBN: 0672322234
Table of Pages: 1128

Contents
• Index C++ Primer Plus, Fourth Edition presents the ANSI C++ standard beginning with a
discussion of the essential elements of C++ programming: loops, expressions,
functions, and classes. It walks readers through the basics of object-oriented
programming: classes, inheritance, templates, and exceptions, as well as the latest
object-oriented programming techniques. C++ Primer Plus contains hundreds of
sample programs. The friendly tone, concise programs, and end-of-chapter review
exercises allow beginners to write their own programs immediately.

Copyright 777
PREFACE
Preface to the Fourth Edition
Note to Instructors
How This Book Is Organized

ABOUT THE AUTHOR


ACKNOWLEDGMENTS
TELL US WHAT YOU THINK!
Chapter 1. GETTING STARTED
Learning C++
A Little History
Portability and Standards
The Mechanics of Creating a Program
Conventions Used in This Book
Our System

Chapter 2. SETTING OUT TO C++


C++ Initiation
More About C++ Statements
More C++ Statements
Functions
Summary
Review Questions
Programming Exercises

Chapter 3. DEALING WITH DATA


Simple Variables
The const Qualifier
Floating-Point Numbers
C++ Arithmetic Operators
Summary
Review Questions
Programming Exercises
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks.

Chapter 4. COMPOUND TYPES


Introducing Arrays
Strings
Introducing Structures
Unions
Enumerations
Pointers and the Free Store
Pointers, Arrays, and Pointer Arithmetic
Summary
Review Questions
Programming Exercises

Chapter 5. LOOPS AND RELATIONAL EXPRESSIONS


Introducing the for Loop
Relational Expressions
The while Loop
The do while Loop
Loops and Text Input
Nested Loops and Two-Dimensional Arrays
Summary
Review Questions
Programming Exercises

Chapter 6. BRANCHING STATEMENTS AND LOGICAL OPERATORS


The if Statement
Logical Expressions
The cctype Library of Character Functions
The ?: Operator
The switch Statement
The break and continue Statements
Number-Reading Loops
Summary
Review Questions
Programming Exercises

Chapter 7. FUNCTIONS?C++'S PROGRAMMING MODULES


Function Review
Function Arguments and Passing by Value
Functions and Arrays
Functions and Two-Dimensional Arrays
Functions and C-Style Strings
Functions and Structures
Recursion
Pointers to Functions
Summary
Review Questions
Programming Exercises

Chapter 8. ADVENTURES IN FUNCTIONS


Inline Functions
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks.

Reference Variables
Default Arguments
Function Polymorphism (Function Overloading)
Function Templates
Summary
Review Questions
Programming Exercises

Chapter 9. MEMORY MODELS AND NAMESPACES


Separate Compilation
Storage Duration, Scope, and Linkage
Namespaces
Summary
Review Questions
Programming Exercises

Chapter 10. OBJECTS AND CLASSES


Procedural and Object-Oriented Programming
Abstraction and Classes
Class Constructors and Destructors
Knowing Your Objects: The this Pointer
An Array of Objects
Class Scope
An Abstract Data Type
Summary
Review Questions
Programming Exercises

Chapter 11. WORKING WITH CLASSES


Operator Overloading
Time on Our Hands
Introducing Friends
Overloaded Operators: Member Versus Nonmember Functions
More Overloading: A Vector Class
Automatic Conversions and Type Casts for Classes
Summary
Review Questions
Programming Exercises

Chapter 12. CLASSES AND DYNAMIC MEMORY ALLOCATION


Dynamic Memory and Classes
A Queue Simulation
Summary
Review Questions
Programming Exercises

Chapter 13. CLASS INHERITANCE


Beginning with a Simple Base Class
Special Relationships
Inheritance?An Is-a Relationship
Polymorphic Public Inheritance
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks.

Access Control-protected
Abstract Base Classes
Inheritance and Dynamic Memory Allocation
Class Design Review
Summary
Review Questions
Programming Exercises

Chapter 14. REUSING CODE IN C++


Classes with Object Members
Private Inheritance
Multiple Inheritance
Class Templates
Summary
Review Questions
Programming Exercises

Chapter 15. FRIENDS, EXCEPTIONS, AND MORE


Friends
Nested Classes
Exceptions
RTTI
Type Cast Operators
Summary
Review Questions
Programming Exercises

Chapter 16. THE string CLASS AND THE STANDARD TEMPLATE LIBRARY
The string Class
The auto_ptr Class
The Standard Template Library
Generic Programming
Function Objects (aka Functors)
Algorithms
Other Libraries
Summary
Review Questions
Programming Exercises

Chapter 17. INPUT, OUTPUT, AND FILES


An Overview of C++ Input and Output
Output with cout
Input with cin
File Input and Output
Incore Formatting
What Now?
Summary
Review Questions
Programming Exercises

Appendix A. NUMBER BASES


This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks.

Octal Integers
Hexadecimal Numbers
Binary Numbers
Binary and Hex

Appendix B. C++ KEYWORDS


Appendix C. THE ASCII CHARACTER SET
Appendix D. OPERATOR PRECEDENCE
Appendix E. OTHER OPERATORS
Bitwise Operators
Member Dereferencing Operators

Appendix F. THE string TEMPLATE CLASS


Thirteen Types and a Constant
Data Information, Constructors, and So On
String Access
Basic Assignment
String Searching
Comparison Methods and Functions
String Modifiers
Output and Input

Appendix G. THE STL METHODS AND FUNCTIONS


Members Common to All Containers
Additional Members for Vectors, Lists, and Deques
Additional Members for Sets and Maps
STL Functions

Appendix H. SELECTED READINGS


Appendix I. CONVERTING TO ANSI/ISO STANDARD C++
Preprocessor Directives
Use Function Prototypes
Type Casts
Become Familiar with C++ Features
Use the New Header Organization
Use Namespaces
Use the autoptr Template
Use the string Class
Use the STL

Appendix J. ANSWERS TO REVIEW QUESTIONS


Chapter 2
Chapter 3
Chapter 4
Chapter 5
Chapter 6
Chapter 7
Chapter 8
Chapter 9
Chapter 10
Chapter 11
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

Chapter 12
Chapter 13
Chapter 14
Chapter 15
Chapter 16
Chapter 17

Index

Copyright

Copyright ©2002 by Sams Publishing

All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted
by any means, electronic, mechanical, photocopying, recording, or otherwise, without written
permission from the publisher. No patent liability is assumed with respect to the use of the information
contained herein. Although every precaution has been taken in the preparation of this book, the
publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for
damages resulting from the use of the information contained herein.

Library of Congress Catalog Card Number: 2001089224

Printed in the United States of America

First Printing: November 2001

03 02 01 00 4 3 2 1

Trademarks

All terms mentioned in this book that are known to be trademarks or service marks have been
appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use of a
term in this book should not be regarded as affecting the validity of any trademark or service mark.

Warning and Disclaimer

Every effort has been made to make this book as complete and as accurate as possible, but no
warranty or fitness is implied. The information provided is on an "as is" basis. The author and the
publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or
damages arising from the information contained in this book or from the use of the programs
accompanying it.

Credits
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

ASSOCIATE PUBLISHER

Linda Engelman

ACQUISITIONS EDITOR

Linda Scharp

DEVELOPMENT EDITOR

Karen Wachs

MANAGING EDITOR

Charlotte Clapp

INDEXER

Kelly Castell

PROOFREADERS

Bob LaRoche

Jessica McCarty

TECHNICAL EDITORS

Philippe Bruno

Bill Craun

Michael Maddox

Chris Maunder

TEAM COORDINATOR

Lynne Williams

INTERIOR DESIGNER

Gary Adair

COVER DESIGNER

Gary Adair

PAGE LAYOUT
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

Ayanna Lacey

Stacey Richwine-DeRome

DEDICATION

To my colleagues and students at the College of Marin, with whom it is a pleasure to work.

—Stephen Prata

PREFACE

Preface to the Fourth Edition


Note to Instructors
How This Book Is Organized

Preface to the Fourth Edition

Learning C++ is an adventure of discovery, particularly because the language accommodates several
programming paradigms, including object-oriented programming, generic programming, and the
traditional procedural programming. C++ has been a moving target as the language added new
features, but now, with the ISO/ANSI C++ Standard of 1998 in place, the language has stabilized.
Contemporary compilers support most or all of the features mandated by the standard, and
programmers have had time to get used to applying these features. The Fourth Edition of C++ Primer
Plus reflects the ISO/ANSI standard and describes this matured version of C++.

C++ Primer Plus integrates discussing the basic C language with presenting C++ features, making this
book self-contained. It presents C++ fundamentals and illustrates them with short, to-the-point
programs that are easy to copy and experiment with. You'll learn about input and output, how to make
programs perform repetitive tasks and make choices, the many ways to handle data, and how to use
functions. You'll learn about the many features C++ has added to C, including the following:

Classes and objects

Inheritance

Polymorphism, virtual functions, and RTTI (runtime type identification)

Function overloading

Reference variables

Generic, or type-independent programming, as provided by templates and the Standard


Template Library (STL)
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

The exception mechanism for handling error conditions

Namespaces for managing names of functions, classes, and variables

C++ Primer Plus brings several virtues to the task of presenting all this material. It builds upon the
primer tradition begun by C Primer Plus nearly two decades ago and embraces its successful
philosophy:

A primer should be an easy-to-use, friendly guide.

A primer doesn't assume that you already are familiar with all relevant programming concepts.

A primer emphasizes hands-on learning with brief, easily typed examples that develop your
understanding a concept or two at a time.

A primer clarifies concepts with illustrations.

A primer provides questions and exercises to let you test your understanding, making the book
suitable for self-learning or for the classroom.

The book helps you understand this rich language and how to use it.

It provides conceptual guidance about when to use particular features, such as using public
inheritance to model what are known as is-a relationships.

It illustrates common C++ programming idioms and techniques.

It provides a variety of sidebars, including tips, cautions, and real-world notes.

We (the author and editors) do our best to keep the presentation to-the-point, simple, and fun. Our goal
is that by the end of the book you'll be able to write solid, effective programs and enjoy yourself doing
so.

Like the previous editions, this book practices generic C++ so that it is not tied to any particular kind of
computer, operating system, or compiler. All the programs were tested with CodeWarrior Pro 6
(Macintosh and Windows) and Microsoft Visual C++ 6.0, and most were tested with Borland C++
Command-Line Compiler 5.5, Gnu g++ 2.9.5 running under DOS, and Comeau C/C++ 4.42.5 running
under Linux. Only a few programs were affected by compiler non-conformance issues.

C++ offers a lot to the programmer; learn and enjoy!

Note to Instructors

One of the goals of the fourth edition is to provide a book that can be used as either a teach-yourself
book or a textbook. Here are some of the features that support using C++ Primer Plus, Fourth Edition
as a textbook:
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

This book describes generic C++, so it isn't dependent upon a particular implementation.

The contents track the ISO/ANSI C++ standards committee's work and include discussions of
templates, the Standard Template Library, the string class, exceptions, RTTI, and namespaces.

It doesn't assume prior knowledge of C, so it can be used without a C prerequisite. (Some


programming background is desirable, however.)

Topics are arranged so that the early chapters can be covered rapidly as review chapters for
courses that do have a C prerequisite.

Chapters have review questions and programming exercises.

The book introduces several topics appropriate for computer science courses, including abstract
data types, stacks, queues, simple lists, simulations, generic programming, and using recursion
to implement a divide-and-conquer strategy.

Most chapters are short enough to cover in a week or less.

The book discusses when to use certain features as well as how to use them. For example, it
links public inheritance to is-a relationships and composition and private inheritance to has-a
relationships, and it discusses when to use virtual functions and when not to.

How This Book Is Organized

This book is divided into 17 chapters and 10 appendixes summarized here.

Chapter 1: Getting Started

This chapter relates how Bjarne Stroustrup created the C++ programming language by adding
object-oriented programming support to the C language. You'll learn the distinctions between
procedural languages, such as C, and object-oriented languages, such as C++. You'll read about the
joint ANSI/ISO work to develop a C++ standard. The chapter discusses the mechanics of creating a
C++ program, outlining the approach for several current C++ compilers. Finally, it describes the
conventions used in this book.

Chapter 2: Setting Out to C++

Chapter 2 guides you through the process of creating simple C++ programs. You'll learn about the role
of the main() function and about some of the kinds of statements that C++ programs use. You'll use
the predefined cout and cin objects for program output and input, and you'll learn about creating and
using variables. Finally, you'll be introduced to functions, C++'s programming modules.

Chapter 3: Dealing with Data

C++ provides built-in types for storing two kinds of data: integers (numbers with no fractional parts) and
floating-point numbers (numbers with fractional parts). To meet the diverse requirements of
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

programmers, C++ offers several types in each category. This chapter discusses these types, including
creating variables and writing constants of various types. You'll also learn how C++ handles implicit
and explicit conversions from one type to another.

Chapter 4: Compound Types

C++ lets you construct more elaborate types from the basic built-in types. The most advanced form is
the class, discussed in Chapters 10, 11, 12, 13 and 14. This chapter discusses other forms, including
arrays, which hold several values of a single type; structures, which hold several values of unlike
types; and pointers, which identify locations in memory. You'll also learn how to create and store text
strings and to handle text input and output. Finally, you'll learn some of the ways C++ handles memory
allocation, including the new and delete operators for managing memory explicitly.

Chapter 5: Loops and Relational Expressions

Programs often must perform repetitive actions, and C++ provides three looping structures for that
purpose: the for loop, the while loop, and the do while loop. Such loops must know when they should
terminate, and the C++ relational operators enable you to create tests to guide such loops. You'll also
learn how to create loops that read and process input character-by-character. Finally, you'll learn how
to create two-dimensional arrays and how to use nested loops to process them.

Chapter 6: Branching Statements and Logical Operators

Programs can behave intelligently if they can tailor their behavior to circumstances. In this chapter
you'll learn how to control program flow by using the if , if else , and switch statements and the
conditional operator. You'll learn how to use logical operators to help express decision-making tests.
Also, you'll meet the cctype library of functions for evaluating character relations, such as testing
whether a character is a digit or a nonprinting character.

Chapter 7: Functions?C++'s Programming Modules

Functions are the basic building blocks of C++ programming. This chapter concentrates on features
that C++ functions share with C functions. In particular, you'll review the general format of a function
definition and examine how function prototypes increase the reliability of programs. Also, you'll
investigate how to write functions to process arrays, character strings, and structures. Next you'll learn
about recursion, which is when a function calls itself, and see how it can be used to implement a
divide-and-conquer strategy. Finally, you'll meet pointers to functions, which enable you to use a
function argument to tell one function to use a second function.

Chapter 8: Adventures in Functions

This chapter explores the new features C++ adds to functions. You'll learn about inline functions, which
can speed program execution at the cost of additional program size. You'll work with reference
variables, which provide an alternative way to pass information to functions. Default arguments let a
function automatically supply values for function arguments that you omit from a function call. Function
overloading lets you create functions having the same name but taking different argument lists. All
these features have frequent use in class design. Also, you'll learn about function templates, which
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

allow you to specify the design of a family of related functions.

Chapter 9: Memory Models and Namespaces

This chapter discusses putting together multifile programs. It examines your choices in allocating
memory, looking at different methods of managing memory and at scope, linkage, and namespaces,
which determine what parts of a program know about a variable.

Chapter 10: Objects and Classes

A class is a user-defined type, and an object is an instance of a class, such as a variable. This chapter
introduces you to object-oriented programming and to class design. A class declaration describes the
information stored in a class object and also the operations (class methods) allowed for class objects.
Some parts of an object are visible to the outside world (the public portion), and some are hidden (the
private portion). Special class methods (constructors and destructors) come into play when objects are
created and destroyed. You will learn about all this and other class details in this chapter, and you'll
see how classes can be used to implement abstract data types (ADTs), such as a stack.

Chapter 11: Working with Classes

In this chapter you'll further your understanding of classes. First you'll learn about operator
overloading, which lets you define how operators such as + will work with class objects. You'll learn
about friend functions, which can access class data that's inaccessible to the world at large. You'll see
how certain constructors and overloaded operator member functions can be used to manage
conversion to and from class types.

Chapter 12: Classes and Dynamic Memory Allocation

Often it's useful to have a class member point to dynamically allocated memory. If you use new in a
class constructor to allocate dynamic memory, you incur the responsibilities of providing an appropriate
destructor, of defining an explicit copy constructor, and of defining an explicit assignment operator.
This chapter shows you how and discusses the behavior of the member functions generated implicitly
if you fail to provide explicit definitions. You'll also expand your experience with classes by using
pointers to objects and studying a queue simulation problem.

Chapter 13: Class Inheritance

One of the most powerful features of object-oriented programming is inheritance, by which a derived
class inherits the features of a base class, enabling you to reuse the base class code. This chapter
discusses public inheritance, which models is-a relationships, meaning that a derived object is a
special case of a base object. For example, a physicist is a special case of a scientist. Some
inheritance relationships are polymorphic, meaning you can write code using a mixture of related
classes for which the same method name may invoke behavior that depends upon the object type.
Implementing this kind of behavior necessitates using a new kind of member function called a virtual
function. Sometimes abstract base classes are the best approach to inheritance relationships. This
chapter discusses these matters, pointing out when public inheritance is appropriate and when it is not.
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

Chapter 14: Reusing Code in C++

Public inheritance is just one way to reuse code. This chapter looks at several other ways.
Containment is when one class contains members that are objects of another class. It can be used to
model has-a relationships, in which one class has components of another class. For example, an
automobile has a motor. You also can use private and protected inheritance to model such
relationships. This chapter shows you how and points out the differences among the different
approaches. Also, you'll learn about class templates, which let you define a class in terms of some
unspecified generic type, then use the template to create specific classes in terms of specific types. For
example, a stack template enables you to create a stack of integers or a stack of strings. Finally, you'll
learn about multiple public inheritance, whereby a class can derive from more than one class.

Chapter 15: Friends, Exceptions, and More

This chapter extends the discussion of friends to include friend classes and friend member functions.
Then it presents several new developments in C++, beginning with exceptions, which provide a
mechanism for dealing with unusual program occurrences, such an inappropriate function argument
values or running out of memory. Then you'll learn about RTTI (runtime type information), a
mechanism for identifying object types. Finally, you'll learn about the safer alternatives to unrestricted
typecasting.

Chapter 16: The string Class and the Standard Template Library

This chapter discusses some useful class libraries recently added to the language. The string class is
a convenient and powerful alternative to traditional C-style strings. The auto_ptr class helps manage
dynamically allocated memory. The Standard Template Library (STL) provides several generic
containers, including template representations of arrays, queues, lists, sets, and maps. It also provides
an efficient library of generic algorithms that can be used with STL containers and also with ordinary
arrays.

Chapter 17: Input, Output, and Files

This chapter reviews C++ I/O and discusses how to format output. You'll learn how to use class
methods to determine the state of an input or output stream and to see, for example, if there has been
a type mismatch on input or if end-of-file has been detected. C++ uses inheritance to derive classes for
managing file input and output. You'll learn how to open files for input and output, how to append data
to a file, how to use binary files, and how to get random access to a file. Finally, you'll learn how to
apply standard I/O methods to read from and write to strings.

Appendix A: Number Bases

This appendix discusses octal, hexadecimal, and binary numbers.

Appendix B: C++ Keywords

This appendix lists C++ keywords.

Appendix C: The ASCII Character Set


This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

This appendix lists the ASCII character set along with decimal, octal, hexadecimal, and binary
representations.

Appendix D: Operator Precedence

This appendix lists the C++ operators in order of decreasing precedence.

Appendix E: Other Operators

This appendix summarizes those C++ operators, such as the bitwise operators, not covered in the
main body of the text.

Appendix F: The string Template Class

This appendix summarizes string class methods and functions.

Appendix G: The STL Methods and Functions

This appendix summarizes the STL container methods and the general STL algorithm functions.

Appendix H: Selected Readings

This appendix lists some books that can further your understanding of C++.

Appendix I: Converting to ANSI/ISO Standard C++

This appendix provides guidelines for moving from C and older C++ implementations to Standard C++.

Appendix J: Answers to Review Questions

This appendix contains the answers to the review questions posed at the end of each chapter.

ABOUT THE AUTHOR

Stephen Prata teaches astronomy, physics, and computer science at the College of Marin in Kentfield,
California. He received his B.S. from the California Institute of Technology and his Ph.D. from the
University of California, Berkeley. Stephen has authored or coauthored over a dozen books for The
Waite Group. He wrote The Waite Group's New C Primer Plus, which received the Computer Press
Association's 1990 Best How-to Computer Book Award and The Waite Group's C++ Primer Plus,
nominated for the Computer Press Association's Best How-to Computer Book Award in 1991.

ACKNOWLEDGMENTS

ACKNOWLEDGMENTS TO THE FOURTH EDITION

Several editors from Pearson and from Sams helped originate and maintain this project, so thanks to
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

Linda Sharp, Karen Wachs, and Laurie McGuire. Thanks, too, to Michael Maddox, Bill Craun, Chris
Maunder, and Phillipe Bruno for providing technical review and editing. And thanks again to Michael
Maddox and Bill Craun for supplying the material for the Real World Notes. Also, thank you Ron
Leichty of Metroworks and Greg Comeau of Comeau Computing for your help with the new C99
features and your noteworthy commitment to customer service.

ACKNOWLEDGMENTS TO THE THIRD EDITION

I'd like to thank the editors from Macmillan Press and Waite Group Press for the roles they played in
putting this book together: Tracy Dunkelberger, Susan Walton, and Andrea Rosenberg. Thanks, too, to
Russ Jacobs for his content and technical editing. From Metrowerks, I'd like to thank Dave Mark, Alex
Harper, and especially Ron Liechty, for their help and cooperation.

ACKNOWLEDGMENTS TO THE SECOND EDITION

I'd like to thank Mitchell Waite and Scott Calamar for supporting a second edition and Joel Fugazzotto
and Joanne Miller for guiding the project to completion. Thanks to Michael Marcotty of Metrowerks for
dealing with my questions about their beta version CodeWarrior compiler. I'd also like to thank the
following instructors for taking the time to give us feedback on the first edition: Jeff Buckwalter, Earl
Brynner, Mike Holland, Andy Yao, Larry Sanders, Shahin Momtazi, and Don Stephens. Finally, I wish
to thank Heidi Brumbaugh for her helpful content editing of new and revised material.

ACKNOWLEDGMENTS TO THE FIRST EDITION

Many people have contributed to this book. In particular, I wish to thank Mitch Waite for his work in
developing, shaping, and reshaping this book, and for reviewing the manuscript. I appreciate Harry
Henderson's work in reviewing the last few chapters and in testing programs with the Zortech C++
compiler. Thanks to David Gerrold for reviewing the entire manuscript and for championing the needs
of less-experienced readers. Also thanks to Hank Shiffman for testing programs using Sun C++ and to
Kent Williams for testing programs with AT&T cfront and with G++. Thanks to Nan Borreson of Borland
International for her responsive and cheerful assistance with Turbo C++ and Borland C++. Thank you,
Ruth Myers and Christine Bush, for handling the relentless paper flow involved with this kind of project.
Finally, thanks to Scott Calamar for keeping everything on track.

TELL US WHAT YOU THINK!

As the reader of this book, you are our most important critic and commentator. We value your opinion
and want to know what we're doing right, what we could do better, what areas you'd like to see us
publish in, and any other words of wisdom you're willing to pass our way.

As an Associate Publisher for Sams, I welcome your comments. You can e-mail or write me directly to
let me know what you did or didn't like about this book—as well as what we can do to make our books
stronger.

Please note that I cannot help you with technical problems related to the topic of this book, and that
due to the high volume of mail I receive, I might not be able to reply to every message.
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks .

When you write, please be sure to include this book's title and author as well as your name and phone
or fax number. I will carefully review your comments and share them with the author and editors who
worked on the book.

E-mail: [email protected]
Mail: Linda Engelman
Sams
201 West 103rd Street
Indianapolis, IN 46290 USA
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

CONTENTS

Chapter 1. GETTING STARTED

You will learn about the following in this chapter:

Learning C++
A Little History
Portability and Standards
The Mechanics of Creating a Program
Conventions Used in This Book
Our System

Welcome to C++! This exciting language, blending the C language with support for
object-oriented programming, became one of the most important programming
languages of the 1990s and continues strongly into the 2000s. Its C ancestry brings to
C++ the tradition of an efficient, compact, fast, and portable language. Its
object-oriented heritage brings C++ a fresh programming methodology designed to
cope with the escalating complexity of modern programming tasks. Its template
features bring yet another new programming methodology, generic programming. This
triple heritage is both a blessing and a bane. It makes the language very powerful, but
it also means there's more to learn.

In this chapter we'll explore C++'s background further and then go over some of the
ground rules for creating C++ programs. The rest of the book teaches you to use the
C++ language, going from the modest basics of the language to the glory of
object-oriented programming (OOP) and its supporting cast of new jargon—objects,
classes, encapsulation, data hiding, polymorphism, and inheritance, then on to its
support of generic programming. (Of course, as you learn C++, these terms will be
transformed from buzzwords to the necessary vocabulary of cultivated discourse.)

Learning C++

C++ joins three separate programming traditions—the procedural language tradition,


represented by C; the object-oriented language tradition, represented by the class
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

enhancements C++ adds to C; and generic programming, supported by C++


templates. This chapter will look into those traditions shortly. But first, let's consider
what this heritage implies about learning C++. One reason to use C++ is to avail
yourself of its object-oriented features. To do so, you need a sound background in
standard C, for that language provides the basic types, operators, control structures,
and syntax rules. So, if you already know C, you're poised to learn C++. But it's not
just a matter of learning a few more keywords and constructs. Going from C to C++
involves about as much work as learning C in the first place. Also, if you know C, you
must unlearn some programming habits as you make the transition to C++. If you don't
know C, you have to master the C components, the OOP components, and the
generic components to learn C++, but at least you may not have to unlearn
programming habits. If you are beginning to think that learning C++ may involve some
mind-stretching effort on your part, you're right. This book will guide you through the
process in a clear, helpful manner, one step at a time, so the mind-stretching will be
sufficiently gentle to leave your brain resilient.

C++ Primer Plus approaches C++ by teaching both its C basis and its new
components, so this book assumes you have no prior knowledge of C. You'll start by
learning the features C++ shares with C. Even if you know C, you may find this part of
the book a good review. Also, it points out concepts that will become important later,
and it indicates where C++ differs from C. After you are well-founded in the basics of
C, you'll add the C++ superstructure. At this point you'll learn about objects and
classes and how C++ implements them. And you will learn about templates.

This book is not intended to be a complete C++ reference; it won't explore every nook
and cranny of the language. But you will learn all the major features of the language,
including some, like templates, exceptions, and namespaces, that are more recent
additions.

Now let's take a brief look at some of C++'s background.

A Little History

Computer technology has evolved at an amazing rate during the last few decades.
Today a laptop computer can compute faster and store more information than the
mainframe computers of thirty years ago. (Quite a few programmers can recall bearing
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

offerings of decks of punched cards to be submitted to a mighty, room-filling computer


system with a majestic 100KB of memory—not enough memory to run a good
personal computer game today.) Computer languages have evolved, too. The
changes may not be as dramatic, but they are important. Bigger, more powerful
computers spawn bigger, more complex programs which, in turn, raise new problems
in program management and maintenance.

In the 1970s, languages like C and Pascal helped usher in an era of structured
programming, a philosophy that brought some order and discipline to a field badly in
need of these qualities. Besides providing the tools for structured programming, C also
produced compact, fast-running programs along with the ability to address hardware
matters, such as managing communication ports and disk drives. These gifts helped
make C the dominant programming language in the 1980s. Meanwhile, the 1980s
witnessed the growth of a new programming paradigm: object-oriented programming,
or OOP, as embodied in languages such as SmallTalk and C++. Let's examine these
two developments (C and OOP) a bit more closely.

The C Language

In the early 1970s, Dennis Ritchie of Bell Laboratories was working on a project to
develop the UNIX operating system. (An operating system is a set of programs that
manages a computer's resources and handles its interactions with users. For example,
it's the operating system that puts the system prompt onscreen and that runs
programs for you.) For this work Ritchie needed a language that was concise, that
produced compact, fast programs, and that could control hardware efficiently.
Traditionally, programmers met these needs by using assembly language, which is
closely tied to a computer's internal machine language. However, assembly language
is a low-level language, that is, it is specific to a particular computer processor. So if
you want to move an assembly program to a different kind of computer, you may have
to completely rewrite the program using a different assembly language. It was a bit as
if each time you bought a new car, you found that the designers decided to change
where the controls went and what they did, forcing you to relearn how to drive. But
UNIX was intended to work on a variety of computer types (or platforms). That
suggested using a high-level language. A high-level language is oriented towards
problem-solving instead of towards specific hardware. Special programs called
compilers translate a high-level language to the internal language of a particular
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

computer. Thus, you can use the same high-level language program on different
platforms by using a separate compiler for each platform. Ritchie wanted a language
that combined low-level efficiency and hardware access with high-level generality and
portability. So, building from older languages, he created C.

C Programming Philosophy

Because C++ grafts a new programming philosophy onto C, we should first take a look
at the older philosophy that C follows. In general, computer languages deal with two
concepts—data and algorithms. The data constitute the information a program uses
and processes. The algorithms are the methods the program uses (see Figure 1.1). C,
like most mainstream languages to date, is a procedural language. That means it
emphasizes the algorithm side of programming. Conceptually, procedural
programming consists of figuring out the actions a computer should take and then
using the programming language to implement those actions. A program prescribes a
set of procedures for the computer to follow to produce a particular outcome, much as
a recipe prescribes a set of procedures for a cook to follow to produce a cake.

Figure 1.1. Data + algorithms = program.


This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

Earlier procedural languages, such as FORTRAN and BASIC, ran into organizational
problems as programs grew larger. For example, programs often use branching
statements, which route execution to one or another set of instructions depending
upon the result of some sort of test. Many older programs had such tangled routing
(called "spaghetti programming") that it was virtually impossible to understand a
program by reading it, and modifying such a program was an invitation to disaster. In
response, computer scientists developed a more disciplined style of programming
called structured programming. C includes features to facilitate this approach. For
example, structured programming limits branching (choosing which instruction to do
next) to a small set of well-behaved constructions. C incorporates these constructions
(the for loop, the while loop, the do while loop, and the if else statement) into its
vocabulary.

Top-down design was another of the new principles. The idea is to break a large
program into smaller, more manageable tasks. If one of these tasks is still too broad,
divide it into yet smaller tasks. Continue with this process until the program is
compartmentalized into small, easily programmed modules. (Organize your study.
Aargh! Well, organize your desk, your table top, your filing cabinet, and your
bookshelves. Aargh! Well, start with the desk and organize each drawer, starting with
the middle one. Hmmm, perhaps I can manage that task.) C's design facilitates this
approach, encouraging you to develop program units called functions to represent
individual task modules. As you may have noticed, the structured programming
techniques reflect a procedural mind-set, thinking of a program in terms of the actions
it performs.

Object-Oriented Programming

Although the principles of structured programming improved the clarity, reliability, and
ease of maintenance of programs, large-scale programming still remains a challenge.
Object-oriented programming (OOP) brings a new approach to that challenge. Unlike
procedural programming, which emphasizes algorithms, OOP emphasizes the data.
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

Rather than trying to fit a problem to the procedural approach of a language, OOP
attempts to fit the language to the problem. The idea is to design data forms that
correspond to the essential features of a problem.

In C++, a class is a specification describing such a new data form, and an object is a
particular data structure constructed according to that plan. For example, a class could
describe the general properties of a corporation executive (name, title, salary, unusual
abilities, for example), while an object would represent a specific executive (Guilford
Sheepblat, vice president, $325,000, knows how to use a CONFIG.SYS file). In
general, a class defines what data are used to represent an object and the operations
that can be performed upon that data. For example, suppose you were developing a
computer drawing program capable of drawing a rectangle. You could define a class
to describe a rectangle. The data part of the specification could include such things as
the location of the corners, the height and width, the color and style of the boundary
line, and the color and pattern used to fill the rectangle. The operations part of the
specification could include methods for moving the rectangle, resizing it, rotating it,
changing colors and patterns, and copying the rectangle to another location. If you
then use your program to draw a rectangle, it will create an object according to the
class specification. That object will hold all the data values describing the rectangle,
and you can use the class methods to modify that rectangle. If you draw two
rectangles, the program will create two objects, one for each rectangle.

The OOP approach to program design is to first design classes that accurately
represent those things with which the program deals. A drawing program, for example,
might define classes to represent rectangles, lines, circles, brushes, pens, and the
like. The class definitions, recall, include a description of permissible operations for
each class, such as moving a circle or rotating a line. Then you proceed to design a
program using objects of those classes. The process of going from a lower level of
organization, such as classes, to a higher level, such as program design, is called
bottom-up programming.

There's more to OOP programming than the binding of data and methods into a class
definition. OOP, for example, facilitates creating reusable code, and that eventually
can save a lot of work. Information hiding safeguards data from improper access.
Polymorphism lets you create multiple definitions for operators and functions, with the
programming context determining which definition is used. Inheritance lets you derive
new classes from old ones. As you can see, object-oriented programming introduces
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

many new ideas and involves a different approach to programming than does
procedural programming. Instead of concentrating on tasks, you concentrate on
representing concepts. Instead of taking a top-down programming approach, you
sometimes take a bottom-up approach. This book will guide you through all these
points with plenty of easily grasped examples.

Designing a useful, reliable class can be a difficult task. Fortunately, OOP languages
make it simple to incorporate existing classes into your own programming. Vendors
provide a variety of useful class libraries, including libraries of classes designed to
simplify creating programs for environments such as Windows or the Macintosh. One
of the real benefits of C++ is that it lets you easily reuse and adapt existing,
well-tested code.

Generic Programming

Generic programming is yet another programming paradigm supported by C++. It


shares with OOP the aim of making it simpler to reuse code and the technique of
abstracting general concepts. But while OOP emphasizes the data aspect of
programming, generic programming emphasizes the algorithmic aspect. And its focus
is different. OOP is a tool for managing large projects, while generic programming
provides tools for performing common tasks, such as sorting data or merging lists. The
term generic means to create code that is type-independent. C++ data
representations come in many types—integers, numbers with fractional parts,
characters, strings of characters, user-defined compound structures of several types.
If, for example, you wanted to sort data of these various types, you normally have to
create a separate sorting function for each type. Generic programming involves
extending the language so that you can write a function for a generic (that is, not
specified) type once, and use it for a variety of actual types. C++ templates provide a
mechanism for doing that.

C++

Like C, C++ began its life at Bell Labs, where Bjarne Stroustrup developed the
language in the early 1980s. In his own words, "C++ was designed primarily so that
my friends and I would not have to program in assembler, C, or various modern
This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

high-level languages. Its main purpose was to make writing good programs easier and
more pleasant for the individual programmer" (Bjarne Stroustrup, The C++
Programming Language. Third Edition. Reading, MA: Addison-Wesley Publishing
Company, 1997).

Stroustrup was more concerned with making C++ useful than with enforcing particular
programming philosophies or styles. Real programming needs are more important
than theoretical purity in determining C++ language features. Stroustrup based C++
on C because of C's brevity, its suitability to system programming, its widespread
availability, and its close ties to the UNIX operating system. C++'s OOP aspect was
inspired by a computer simulation language called Simula67. Stroustrup added OOP
features and generic programming support to C without significantly changing the C
component. Thus C++ is a superset of C, meaning that any valid C program is a valid
C++ program, too. There are some minor discrepancies, but nothing crucial. C++
programs can use existing C software libraries. Libraries are collections of
programming modules that you can call up from a program. They provide proven
solutions to many common programming problems, thus saving you much time and
effort. This has helped the spread of C++.

The name C++ comes from the C increment operator ++, which adds 1 to the value of
a variable. The name C++ correctly suggests an augmented version of C.

A computer program translates a real-life problem into a series of actions to be taken


by a computer. While the OOP aspect of C++ gives the language the ability to relate to
concepts involved in the problem, the C part of C++ gives the language the ability to
get close to the hardware (see Figure 1.2). This combination of abilities has helped
the spread of C++. It may also involve a mental shift of gears as you turn from one
aspect of a program to another. (Indeed, some OOP purists regard adding OOP
features to C akin to adding wings to a pig, albeit a lean, efficient pig.) Also, because
C++ grafts OOP onto C, you can ignore C++'s object-oriented features. But you'll miss
a lot if that's all you do.

Figure 1.2. C++ duality.


Exploring the Variety of Random
Documents with Different Content
seemed asleep, and no sentinel had given the alarm. The leader of
the expedition, satisfied with the result which he fancied he had
obtained, was preparing to return to Santiago to report the result of
his reconnoisance to the besieged, when, on turning back, he found
every line of retreat interrupted, and a countless swarm of Indians
surrounding him.
The officer who had fallen into the trap did the only thing that was
left him: he fell bravely at the head of the men whom he
commanded. On the next morning, at sunrise, two hundred heads,
scalped and horribly disfigured, were thrown by the Moluchos over
the walls of Santiago. The Chilian Spaniards took the hint, and did
not repeat the experiment.
When Tahi-Mari entered the camp with his band, the Indians flocked
up tumultuously, and received him with loud yells of delight. He
made them a sign of thanks, and without checking his pace, went
toward his lodge, in the doorway of which Shounon-Kouiretzi,
crouching on his heels, was gravely smoking. On seeing the
commander he said—
"Tahi-Mari is a great chief; is he contented with his journey?"
"Yes," Diego replied, laconically. "My brother will watch at my door,
and allow no one to enter."
"My brother can trust to me; no one shall enter." And the Indian
began smoking again, impassively. Diego went in, carrying Inez,
wrapped up in a poncho. After removing her bonds, he laid her on
some sheepskins, thrown in a corner of the hut, which served him as
a bed. Then he fetched a calabash of water and dashed the contents
in her face, but Inez still remained motionless.
On seeing this, Diego bent down and devoted to her the greatest
attention, in order to recall her to her senses; anxiously consulting
her pulse, raising her in his arms, tapping her hands, and employing,
in a word, all the means usual for restoring a fainting person. For a
long time his efforts were sterile, and life seemed to have
abandoned the poor girl for ever.
"Can she be dead?" Diego muttered.
And he began attending to her again. At length a sigh burst from
Inez's bosom, she languishingly opened her eyes and uttered a few
broken words in a faint voice. All at once she rose.
"Where am I?" she screamed.
Diego, without answering, fell back into a dark corner of the lodge,
and fixed a serpent glance upon her.
"Where am I?" she repeated. "Maria! sister! how I am suffering! Oh,
Heaven!"
Her memory gradually returned, and everything flooded back to her
mind. Then a shudder of terror agitated all her limbs, her haggard
eyes wandered around, and she perceived Diego.
"Oh, that man!" she said, as she hid her face in her hands. "I am
lost! Great God, I am lost!"
Diego issued from his corner, and with his eyes fixed on her, slowly
advanced toward her. Fascinated by the half-breed's sparkling
glance, she fell back step by step, with her arms stretched out, and
displaying signs of the most violent terror.
"Leave me, leave me!" she murmured. She thus reached the walls of
the hut, clung to the intertwined branches, and stood motionless,
while still looking at her persecutor, who walked toward her with an
ironical smile.
"Leave me!" she repeated, unable to offer Diego any other
resistance but her tears and her despair. But he was not the man to
be affected.
"Leave you!" he answered; "do you fancy that I brought you all this
distance to restore you innocent and pure to those who are dear to
you? Undeceive yourself; henceforth you belong to me, and you will
not leave this spot till you have nothing left to refuse me."
"Oh, mother, mother!"
"Your mother is dead, and no one can come to your assistance—do
you hear; no one?"
"In that case, kill me," Inez cried, as she threw herself at the half-
breed's feet.
"No! it is your honour, not your life, that I must have."
"But what have I done to you? Great Heaven, I am only a poor girl,
and you cannot be so cruel to me without a motive."
"No, you have done nothing to me, and I feel for you neither hatred
nor love; but you are the daughter of General Soto-Mayor. Your
family dishonoured mine, and you will be dishonoured to expiate the
crimes of your relatives."
"Oh, that is frightful; you will not act thus, because you know very
well that I am innocent."
"Your ancestor dishonoured the wife of my grandfather, and she has
still to be avenged."
"Mercy, mercy!"
"No! eye for eye, and tooth for tooth!—for you the shame, for me
the vengeance!"
"In your mother's name, pity!"
"My mother!"
This word produced such an impression on the half-breed that he
bounded with rage, and his face assumed a fresh expression of rage
and fury.
"Ah, you speak to me of my mother! Mad girl! you do not know,
then, that she found herself one day in the path of a Soto-Mayor,
and that he brutally and cowardly plunged her into ignominy in order
to satisfy a moment of brutal desire?"
"Oh, Heavens!" Inez sobbed.
"You do not know that while the poor woman was grovelling in
despair at his feet, and imploring him, in the name of her God, to
spare her, the villain laughed and caught her in his arms. Do you
now understand why I forbid you invoking my mother's name?"
"Oh, I am lost!" Inez said, broken-hearted. "For the man who
avenges himself on the child of his enemy has no heart."
"Yes, you are lost! But if you fancy that my revenge, in seizing you,
has spared your father, you are mistaken, for he died by my hand."
"Woe! woe!" the girl shrieked, mad with grief.
"Yes, crushed by my blows, as I will crush all those of your race! No,
you will not escape me! It is now your turn to cry and groan—your
turn to implore in vain."
And, with the howl of a wild beast, the Indian, whose eyes were
bloodshot, and his mouth foaming, rushed frenziedly at Inez and
hurled her back on the sheepskins. Then ensued a horrible and
nameless struggle, in which the groans of the victim were mingled
with the wild panting of the savage. Inez resisted with the violence
of despair, but soon, crushed by the half-breed's grasp, she lay
helpless, left to the mercy of the man who had sworn her dishonour.
****
"Brother," said Long-Scalp, appearing in the doorway, "two Spanish
chiefs, followed by several lanceros have come to offer propositions
of peace to the toqui of the twelve nations."
"Who are the chiefs?" Diego asked.
"General Don Pedro and Colonel Don Juan de Soto-Mayor," the
Indian replied.
A smile of triumph played round the half-breed's lips.
"Let them come! let them come!" he said.
"Does my brother, Tahi-Mari, consent to receive them?"
"Yes," Diego continued, assuming his Indian stoicism. "My brother
will assemble the great chiefs around the council-fire, and I will
come thither."
Shounon-Kouiretzi bowed and retired.
"The betrothed and the brother. They have arrived too late," Diego
said, so soon as he was alone.
And he left the hut, in order to preside at the council. Inez was
motionless on the couch of Tahi-Mari, the great chief of the
Araucanos.

CHAPTER XXIX.

THE GREEN ROOM.

After wrapping himself carefully in his cloak, Leon pensively went


along the streets leading to Crevel's inn. Diego's last words
incessantly reverted to his mind, and he asked himself why the
Indian had recommended him so eagerly to proceed to the posada.
Another peculiarity, also, kept his mind on the rack; he had seen
Diego take from the hands of the people waiting for him a large
parcel which had all the appearance of a human body. He had also
fancied that he heard a dull and plaintive groan from this bundle.
"What could it be?" Leon asked himself in vain.
At length he reached the Calle San Agostino. The door of Crevel's
inn was ajar, and a bright light illumined the interior. Leon went in.
Crevel, seated at his bar, was talking in a low voice with Wilhelm,
who, with his arms leaning on the chimney, was probably telling him
some improper anecdotes, for the two men were laughing most
heartily. The unforeseen arrival of the captain alone arrested the
flow of their hilarity, and they exchanged a meaning glance which
did not escape Leon.
"Still up!" the latter said.
"We were waiting for you, captain," Crevel answered.
"Thanks; but I would advise you to extinguish your lights, for people
might be surprised at seeing them so late."
"That is quite true," said the landlord.
"Give me the key of the green room," Leon continued. "I need rest,
and I will throw myself on the bed for an hour."
Crevel and Wilhelm looked at each other again, and winked in a
most peculiar way.
"Did you hear me?" Leon resumed.
"Oh, perfectly, captain," the landlord replied. "You can go up, the key
is in the door."
"Very good; in that case give me a light."
"You do not require it, for there is one in the room."
"Ah! now I see that you really did expect me."
"Eh, eh, I am not the only one."
"What do you mean?"
"I? Nothing, captain. Go up and you will see."
"See what?"
"I beg your pardon, captain, I forgot that it did not concern me, and
that—"
"Come, Master Crevel, will you have finished soon or not? Of whom
and of what are you speaking? Make haste and explain yourself."
"Why of the little Señorita up there—by the gods!"
"A woman in my room! Tell me, Wilhelm, do you know what Crevel
is talking about?"
"Well, captain, you must know that—well—since—"
"Ah! I really believe that it would have been wiser to go upstairs and
look for myself, you scoundrels."
And he prepared to ascend the stairs.
"Ah!" he said turning round and addressing Wilhelm; "do not stir
from here without my orders, my boy, for I may want you."
"That is sufficient, captain."
Leon went out of the room, and, as he did so, heard the landlord,
who was fastening his door, say to the German—
"The captain is a lucky fellow."
"That comes of being good-looking, Señor Crevel," the other replied.
More and more puzzled, the captain continued to ascend, and soon
stood before the door of the green room. Crevel had told the truth,
the key was in it, and a light could be seen gleaming through the
cracks. The greatest silence, however, prevailed inside. After a
moment's hesitation, the young man turned the key and entered,
but at the first step he took he stopped and uttered a cry of
surprise.
A young lady, seated in a chair, and dressed in the white garb of the
novices of the Purísima Concepción, was sobbing and hiding her face
in her hands. At the captain's cry, the girl started and quickly raised
her head—it was Maria de Soto-Mayor.
Leon dared not believe his eyes. Maria in the green room! How did
she happen to be here in the middle of the night? What could have
happened? By what concourse of extraordinary events could she
expect his coming? Wild with delight at this sudden apparition, the
captain fell on his knees, murmuring—
"Oh, niña! bless you for being here."
And he tried to seize her hand and press it to his burning lips. Maria
leaped out of the chair in which she was seated, and flashed at him
a glance of supreme disdain.
"Whence, sir," she said, "do you derive the audacity to present
yourself thus to me?"
"Señorita!" Leon said, surprised and discountenanced by Maria's
hurried movement.
"Leave the room, sir," she continued, "and spare me at least the
shame of listening to your remarks."
"Good Heaven!" Leon exclaimed, who began to suspect some
infamous machination; "what have I done that you should treat me
in this way?"
"You ask me what you have done? in truth, I do not know whether I
am dreaming? would you learn it from me, then, and pretend not to
know?"
"Oh, Maria! I am ignorant of the meaning of this: but on my
mother's soul, I swear that a thought of insulting you never crossed
my mind."
"In that case, sir, how do you explain your unworthy conduct?"
"I do not know to what you are alluding."
"Your presence here, sir, is a sufficient proof that you expected to
find me here, even if you thought proper to deny your share in the
abominable scandal which you have caused. Ah, Leon! could I
suppose that you would offer me this outrage by publicly
dishonouring me?"
"Oh!" Leon exclaimed, "there is some infernal mystery in all this.
Maria, once again I swear to you that your every word is an enigma,
and I ask you how it comes that I find you in this inn room when I
believed you at the Convent of the Conception?"
Maria felt her convictions shaken by the accent of truth with which
these words were imprinted: still, being unable to believe in the
smuggler's innocence—so long as it seemed to her impossible that
any other than he should have dreamed of tearing her from the
convent—she resumed, though in certainly a milder tone—
"Listen, Leon. Up to this day I believed you a man full of honour and
loyalty. Now the action which you have committed is infamous; but
tell me that it was suggested to you by some wicked creatures. Tell
me that you have obeyed an evil inspiration, and though I could not
forgive you, for you have ruined me, I would try to forget and pray
Heaven to efface your image from my heart. For mercy's sake let us
leave this den as quickly as possible, and do not prolong a captivity
which covers me with infamy."
"Do you want to drive me mad? Good Heaven! what can have
happened during the hour since I left prison?"
"Prison!"
"Yes, señorita, the day before yesterday, after the visit which I paid
you in the general's company, I was arrested and taken to the
Calabozo, whence I was released scarce an hour ago."
"Can that be true?"
"Yes, on my honour."
"But, in that case, on whose authority did the man act who entered
the convent at the head of his bandits and carried me off by main
force?"
"Oh, Heavens!" said Leon, "that man! Oh, I understand it all now.
Tell me, Maria, did you recognise his features?"
"Stay—yes, yes, it was certainly he."
"Who?"
"Your friend, who accompanied us on the journey to Valdivia."
"Diego!" Leon exclaimed.
"Yes, Diego."
"Oh, woe upon him, then!"
And seizing the bell rope he rang violently. In about a quarter of an
hour, Crevel thrust a startled face through the half-open door.
"Do you want anything, captain?"
"Yes; send up Wilhelm at once."
The banian disappeared. Leon, suffering from a furious agitation,
walked up and down the room displaying all the signs of a passion
on the point of exploding. His face was pale; his muscles were
contracted, and his eyes flashed fire. Wilhelm came in. At the sight
of him Maria gave a start of terror, but Leon reassured her.
"Fear nothing, señorita; you are under my protection."
The German understood that he had committed some folly.
"Wilhelm," Leon said to him, fixing on him a scrutinizing glance,
"listen carefully to what I am going to say to you, and answer me."
"Very good, captain."
"Where did you go the day before yesterday, after my arrest?"
"To Rio Claro, to find the lieutenant."
"What did he say to you?"
"He told me that he wished to deliver you, and gave me the meeting
for last night at ten o'clock."
"He came here? What next?"
"Next, captain," the German said, twisting his hat between his
fingers. "Well, it was—"
"Speak the truth; I insist on it."
"Well, the whole band was assembled."
"And what did you do?"
"Lieutenant Diego told us that you loved a novice in the convent of
the Purísima Concepción, that he had sworn to make her yours, and
we must carry her off."
"And then?"
"Then he led us thither, and by his orders we carried off the señora
and brought her here to Crevel's, while Diego went off with another
girl."
"Another, do you say?"
"Oh, Heaven!" Maria exclaimed.
"But who was it? Will you answer?" Leon commanded him, with a
rough shake.
"On my word, captain, it was Doña Inez, the sister of Doña Maria."
"Malediction!" Leon said, furiously.
"Oh, my sister!—my poor sister!"
"The infamous fellow!" the young man continued; "what frightful
treachery! Henceforth all ties are broken between us. This, then,
was the vengeance he coveted!"
Then, addressing the German, who was looking at him anxiously, he
said—
"Wilhelm, there is not a moment to lose; assemble our men, and let
them all be here within an hour."
"All right, captain."
And the German dashed down the stairs at a tremendous pace. Leon
then turned to Maria, who was sobbing.
"Courage, Señora. I cannot take you back to the convent, where you
would no longer be in safety; but will you join your father at
Santiago?"
"Do not abandon me, Leon, I implore you," she answered. "You
alone can protect me. Oh, my poor sister!"
"If I cannot save her, I will avenge her in an exemplary manner."
The maiden no longer heard him. Absorbed in her grief, she
dreamed of the fatality which had weighed on her ever since the day
when her eyes first met Leon, and derived from them the love which
was destined to change the calm life which she led at the convent
into such terrible trials. Still, on seeing near her Leon—whose
eagerness in lavishing attentions on her was incessant—she gave
him a look of ineffable sweetness, while asking his forgiveness for
having suspected him of complicity in the outrage of which she had
been the victim.
"Maria," Leon said in reply, as he covered her hand with kisses, "do
you not know that I would joyfully sacrifice my life at a sign from
you?"
"Forgive me, Leon, for I should die if your love ceased to be as noble
and pure as your heart."
"My love, Maria, is submissive to your wishes; it is the most fervent
worship—the purifying flame."
"Leon, my sister is perhaps at this time abandoned defencelessly to
the insults of her cowardly ravisher."
"Let me first restore you to your father, and then I will do all in my
power to save your sister."
"What do I not owe you for so much devotion?"
"Have you not told me that you loved me?"
"Yes, Leon, I love you, and am proud of it."
"Oh, thanks!—thanks, Maria! God will bless our love, and I soon
hope to tell your father of it. May he but approve of it."
"Does he not owe to you the life of his children? Oh, when I tell him
how I love you, and how generous your conduct has been, be
assured that he, too, will love you."
While the two young people were indulging in dreams of happiness
and the future, Wilhelm was executing the captain's orders, and
Crevel's posada was again filled by the members of the band. An
hour had not elapsed when he came to tell Leon that everything was
ready for departure.
"In that case," Leon said to him, "all you have to do is to select the
best horse you can find in the landlord's corral, and get it ready for
señorita Maria."
"All right, captain," Wilhelm answered, who knew no phrase better
fitted to display his obedience than the one which he habitually
used.
"All along the road to Santiago you and Joaquin will keep constantly
by her side, and watch her carefully so that no accident may happen
to her. Do you understand?"
"Yes, captain."
"In that case make haste, and here is something to hasten your
movements," Leon continued, taking from his pocket some onzas
and handing them to the German.
"Thanks, captain. You can come down with the niña whenever you
like, for we shall be ready in a moment."
Very shortly after, in truth, Wilhelm was standing before the inn door,
holding two horses—one for Leon, the other for Maria. When left
alone with the latter, the captain took from under his cloak a large
black manta, which he threw over the young lady's shoulders, and
pulled the hood over her face.
"Now," he said to her, "let us go."
"I follow you," Maria answered.
Leaning on the young man's arm, she cautiously descended the
stairs, and found herself in the midst of the smugglers who had
invaded the convent. But, knowing that she was in perfect safety by
Leon's side, she manifested neither surprise nor fear. Assisted by
him, she mounted her horse, seized the reins, and placed herself
resolutely in the first rank between Wilhelm and Joaquin.
The captain, after giving a final glance at his band, to assure himself
that everything was in order, leapt upon the back of his mustang,
and gave the order to start. The smugglers then proceeded at a
sharp trot across the Almendral in order to reach the Santiago road.

CHAPTER XXX.

THE CONFESSION.

General Soto-Mayor had been hurriedly raised by the volunteers,


whom the report of the two pistol shots had attracted to his room, a
surgeon attached to the reinforcing column was summoned, and
hastened to dress the old gentleman's frightful wounds. The terrible
pain which the scalping caused him, and the immense quantity of
blood he had lost, had plunged him into a profound fainting fit, from
which it seemed impossible for him to recover. Upwards of three
hours passed before he gave any signs of life. At length a faint sigh
issued from his oppressed chest: he made a slight movement, his
eyes opened slightly, and he muttered in a low and broken voice—
"Something to drink."
A servant brought him a bowl filled with a potion prepared by the
doctor.
"Oh!" he said, a moment after, "my head is burning; what frightful
pain!"
The surgeon begged him to be silent, administered a second potion,
and a few minutes after the patient's eyes closed. He had fallen
asleep.
"That is what I wanted," the surgeon said, as he felt his pulse and
looked at him attentively.
"Well, doctor," an officer asked, "what do you think of the general's
state?"
"I cannot say anything about it yet, gentlemen," he answered,
addressing the persons who surrounded the old gentleman's bed;
"his wounds are very serious, and yet I do not believe them mortal.
We have numerous examples of scalped persons who have been
perfectly cured. Hence it is not the wound on the head that alarms
me the most, although it is the most painful. Tomorrow, as soon as I
have removed the bandages, I shall be able to tell you what we have
to fear or hope. Now, be kind enough to withdraw; thanks to the
potion, the general is enjoying a calm sleep, but the slightest noise
might disturb him. I will instal myself at his bedside, and not stir till
he is either dead or saved."
Upon this the doctor dismissed all the persons who filled the room,
drew an armchair up to the bed, sat down in it in the most
comfortable posture, took a book from his pocket, and prepared to
spend the night as well as he could in reading. The peons
accompanying the general, on seeing their master in so pitiable a
state, unloaded the baggage and carried it into the casa. Then each
resumed possession of his lodging, while congratulating himself in
his heart at being no longer compelled to expose himself to the
dangers of war.
After the misfortune which occurred to the general, the officer who
took the command of the volunteers in his place sent out heavy
patrols in all directions in pursuit of the Indians; but their search had
no result, and they returned one after the other without discovering
the slightest sign which could put them on the track of the assassins.
They were, therefore, obliged to give up for the present all thoughts
of taking vengeance for the odious attack which had been
committed on the person of General Soto-Mayor.
Still this affair exerted a salutary influence over the mind of the
volunteers. At the sight of so terrible a fact as the one which had
just occurred, they understood how necessary prudence was when
engaged with enemies so invisible and formidable as the Indians.
They, therefore, began subjecting themselves to the claims of
discipline. In consequence, they ceased their cries and songs, and
fulfilled their military duties much more seriously than they had
hitherto done.
The rest of the night passed away calmly and peaceably, and with
the exception of two or three false alarms which the sentries in their
inexperience gave, nothing happened to disturb the tranquillity of
the volunteers encamped under the walls of the Casa de Campos. At
sunrise, when the country illumined by the hot beams had lost the
sinister and gloomy aspect which darkness imparted to it, the
Chilians, who, without confessing it, had been in a state of real
terror, gradually regained courage and recommenced their
gasconade, though it was moderated by the recollections of the
night.
At about eight in the morning the general woke up, and though he
was very low and his weakness was extreme, the long sleep which
he had enjoyed seemed to have greatly relieved his sufferings. The
doctor, after carefully counting his pulse, began removing the
bandages which he had placed. The appearance of the wounds was
excellent; the flesh offered no extraordinary signs of inflammation—
in a word, the patient was going on as well as could be expected.
The wounds were washed, fresh bandages put on, and another
potion made the general fall back almost immediately into the
lethargic sleep from which he had roused himself.
When midday came, the suppurating fever set in with great intensity.
The old man uttered inarticulate cries, made fearful efforts to leap
out of bed, and talked with extraordinary vivacity, making
unconnected remarks, whose meaning it was impossible to
understand. The names of Diego, of Tahi-Mari, and of the different
members of his family incessantly returned. The general was
evidently suffering from some horrible delirium aroused by the
terrible scene of which he had been the victim on the previous
evening. Four powerful men were scarce sufficient to keep him down
in his bed.
From three to four o'clock in the afternoon an improvement took
place; the fever relaxed, the sick man's eyes lost that frightful stare
and expression of wildness which terrified his attendants. He
recognised his domestics, the doctor waiting on him, and even the
officers who surrounded him. Everything led to the hope that the
general would be saved; such at least was the opinion of the
surgeon, who expressed it loudly.
At about six o'clock, the officers whom the general had dispatched to
Santiago, returned to the country house, bearing the instructions of
the President of the Republic. The officer who commanded the
expedition in the general's place, opened and read them. They were
formal.
The president gave orders to General Soto-Mayor to proceed by
forced marches on the capital, which was in the greatest peril: he
added that he could send him no officers, in spite of his urgent
request, and concluded by requesting the general to read the
despatch to the soldiers, in order to make them understand how
much he reckoned on their patriotism in answering the appeal of the
menaced country.
The officer intrusted with the interim command obeyed the orders
which he received. He assembled the troops, read to them in a loud
voice the contents of the despatch, and made them a short speech,
in which, while exalting the powerful help which they might afford to
the inhabitants of Santiago, he asked whether he could really reckon
on them. A universal and enthusiastic outburst was the response to
the general's speech, and immediate preparations were made for the
departure.
The commandant—who did not wish to abandon General Soto-Mayor
defencelessly in his house, which was open to all comers, and might
at any moment be invaded by the Indians—chose from among his
volunteers fifty men, to whom he entrusted the defence of the casa,
after exhorting them to behave properly, and placing them under the
command of an alférez. Then, this duty fulfilled, he took leave of the
surgeon, after recommending him to neglect nothing in restoring the
general's health, and took the road to Santiago at the head of his
volunteers.
The night passed without any incidents worthy of record. The men
left in charge of the house had closed the gates and had entrenched
themselves in the interior. Toward morning they heard the sound of
a horse galloping at full speed. They had scarce time to notice the
rider, who departed rapidly, after halting for an instant before the
house. Some inarticulate sounds reached the ears of the sentries,
but before the latter could think of challenging, horse and rider were
a long distance off. It was Diego returning to Santiago with his
victim.
The general's state was satisfactory; the fever had considerably
decreased, the wounds continued to offer the most favourable
aspect, and with the exception of the atrocious sufferings he felt in
his head, the old gentleman had regained a little calmness. Suddenly
a loud sound of horses was heard on the road, and a servant
hastened into the sick man's chamber, announcing that Captain Leon
Delbès had just arrived, and had important news to communicate to
the general. The surgeon tried to oppose the interview which Leon
requested, alleging that his patient needed absolute repose; but, on
the repeated entreaties of the latter, he was obliged to consent,
though resolved to put a stop to it whenever he thought it advisable.
The captain, as we know, had left Valparaíso in the company of
Maria, with the intention of proceeding under the escort of his band
to Santiago, where he expected to find the general. But, while
passing in front of the country house, he was astonished at seeing;
the gates open, and a picket of lanceros in the courtyard. Not
knowing to what to attribute the warlike appearance which this
peaceful mansion had assumed, he halted his band and went up to
the gate for the purpose of enquiring. The old manservant, who had
been left as guardian, and had admitted his master two days
previously, was at this very moment occupied in front of the house,
and Leon questioned him.
The worthy man then told him in the fullest details the assassination
attempted on the person of his master, and the hopeless efforts
which had been made to discover the perpetrators. On listening to
the narrative, the captain trembled and guessed at once that Diego
must have passed that way. In truth he was the only man he knew
capable of committing a similar crime and surrounding it with such
mystery. Moreover, the project of vengeance which Diego nourished
against the Soto-Mayor family, sufficiently indicated him to Leon for
the latter to entertain no doubt as to his guilt.
Locking up in his bosom the feeling of horror which the half-breed's
deed inspired him with, the captain returned to Maria to announce
to her that her father, rather seriously wounded, was at the moment
at the Casa de Campos, and hence it was unnecessary to go farther,
and if she saw no inconvenience, he would at once place her in his
hands. The young lady who, in following Leon, had no other object
but to join her father and place herself under his protection, begged
to be at once led to him. But, on Leon remarking that her
unexpected presence might be fatal to the general, by causing him
too lively an emotion, she consented that Leon should warn him
first.
The captain led his band into the courtyard, and then sent a footman
to the old gentleman to request an interview. When he entered the
general's bedroom, and found him lying on a bed of pain, with his
head wrapped up and his face more livid than that of a dying man,
he felt affected by the deepest compassion. It was in fact a
melancholy sight to see this old man, who had but a few days
previously been so strong and robust, now broken by suffering and
lying there horribly mutilated.
"Señor Don Juan, it is I, Leon Delbès," he said, addressing the
wounded man.
The general offered him his left hand, and a smile played round his
bloodless lips.
"Have you any new misfortune to announce to me, captain?" the old
man said, in an almost unintelligible voice. "Speak—speak."
Leon started at the sound of this faint voice, and held his tongue,
not daring to tell an unhappy man who was on the brink of the
grave of the new misfortune which had fallen on him without his
knowledge. The general noticed the young man's agitation, and felt
that he had guessed aright.
"It concerns my daughters, does it not?"
"Yes, general," Leon replied, hanging his head sadly.
"Are they dead?" the old man asked, with a tremor in his voice.
The surgeon read in his face the nature of the feelings he was
undergoing, and seemed to fear the captain's answer, but the latter
hastened to speak.
"No, general, they are alive, and one of them accompanies me."
"But the other?"
"Is no longer in Valparaíso."
"What has happened, then, at the Convent of the Conception?—
speak."
"It has been attacked, general."
"I understand," the old man said, "one of my daughters has fallen
again into the hands of the Indians—the name of her who is left
me?"
"Doña Maria, general!"
"And it is again you who restore her to me, my friend. Thank you,
and Heaven grant that I may soon be able to reward you in the way
you deserve."
Leon gave a gesture of refusal.
"Oh! I know how a noble heart like yours should be rewarded."
Leon bowed and made no answer.
"But, for mercy's sake, tell me what you know with reference to
Inez, and do not be afraid of grieving me, for I am resigned to
undergo all the misfortunes which God may send me as an expiation
for my sins."
The young man then told him of the rape of Maria's sister, while
carefully holding his tongue as to the circumstances under which he
had recovered the other young lady. Then he told him of his
intention of going to Santiago to find Diego, in whose power Inez
was. On hearing that it was Tahi-Mari, who had robbed him of his
child, the general, in spite of his courage, felt tears of grief bedew
his eyes.
"O God!" he exclaimed, "punish me if I have offended you, and I will
bow my head beneath the punishment but will you allow this man,
this villain, to heap up crime upon crime, to strip me of what I hold
the dearest?"
There was a moment's silence, which the old gentleman was the
first to interrupt.
"My friend," he said to Leon, "you told me that Maria had been
saved by you, and yet I do not see her."
"She awaits your permission to present herself to you, general."
"Let her come—let her come!"
A peon was ordered to go and fetch Maria, who was kneeling in her
mother's room, and soon after, the maiden was standing before her
father; but on seeing the condition in which the murderer had left
him, she could only sob. The old man made a sign that he wished to
embrace her.
"My daughter," he said, after pressing his lips on the novice's virgin
forehead, "since the walls of a convent have not protected you from
the fury of my enemies, and I know not whether I shall ever see my
other children again, you will henceforth remain with me, if," he
added, "Heaven grant me the strength to live."
"Oh, thanks, father—thanks! for the convent is death, and I wish to
live to love and cherish you."
"What do you say?"
"Forgive me, father, but I suffered so deeply at being separated from
those whom I love."
"This is strange! and yet your sister Inez asked three days ago to
speak to me in private, and asked my permission to take the veil in
the Convent of the Conception, as she was determined not to marry
Don Sallazar, who loves her. I believed that it was you, child, who
had persuaded her to this."
"Oh, no!" Maria murmured.
The doctor, who had hitherto contented himself with displaying the
dissatisfaction which he felt on seeing the general fatigue himself
with talking, thought it prudent not to allow the interview to go on,
and made an observation to that effect.
"Thanks, doctor," said the general, "for the interest you take in my
cure."
"General," said Leon, "the doctor is right; my presence is no longer
necessary here. I will hasten to Santiago, and ere long I hope you
shall hear from me. Señora Doña Maria does not require my services
further, and so I will retire."
"Oh, father!" Maria could not refrain from saying, "if you only knew
how brave and generous he is!"
The general made no reply, and seemed to be reflecting.
"Doctor," he said, suddenly addressing the surgeon, "you must
arrange some plan for transporting me to Santiago."
"What are you thinking of, general?" the other exclaimed, falling
back a couple of steps, so great was his surprise; "it is impossible."
"And yet it must be," the old man remarked calmly. "If my son is still
alive, he is at Santiago with General Don Sallazar; I wish to see
them."
"What?" said Leon.
"Once again, it is impossible," remarked the doctor, who was grieved
to see the obstinacy with which his patient supported his resolve.
"You, Captain Leon," Don Juan continued, "will go on ahead, since
you still offer me your assistance, which has been so precious to me;
we shall meet at my cousin's, Senator Don Henriquez de Castago."
"But, general?"
"But, doctor, you will do whatever you like; have a litter made, or
invent any mode of transport that you please, for I intend to go to
Santiago with my daughter Maria, even if I die on arriving."
"At least, wait a week."
"It is your opinion that I cannot be removed today?"
"Most certainly."
"Well, I will wait till the day after tomorrow; between this and then
prepare all that you want, and do not trouble yourself about the
rest. If an accident happens to me, the blame will rest on myself
alone."
"General!"
"I have spoken, and I warn you that, if you do not consent, I shall
blow out my brains, or rather tear off my bandages, and die here."
And the old gentleman prepared to suit the action to the word.
"Stay!" exclaimed the surgeon, who found himself compelled to
yield, "I will act in accordance with your wishes."
"Very good," the general replied; "and now I will try to take some
rest, for my strength is exhausted, I feel."
Leon prepared to bid farewell to the general, and leave the country
house.
"Good-bye, my friend," the patient murmured; "in two days we shall
meet again, or, if not, it is to you—you alone—I confine the care of
guarding Maria. Go, and may Heaven aid you to find Inez."
Leon bent his knee before the old man.
"Sir," he said to him, with profound emotion, "my life and heart
belong to you; take one and break the other if you like, for I can no
longer conceal from you the secret that devours me—I love your
daughter, Doña Maria."
"Father, father!" Maria also exclaimed, as she fell on her knees by
the side of the general's bed; "forgive me, for I love him in return."
As his sole answer, Don Juan de Soto-Mayor held out his hand to the
young people, who covered it with kisses and burning tears. A
glance of ineffable happiness was exchanged between the smuggler
and the novice.
"Now I am strong," Leon exclaimed, as he rose. "You shall be
avenged, Don Juan."
And he rushed out of the house. In a second, all his men were ready
to start.
"Companions!" he shouted, as he leaped on the back of his
mustang, "to Santiago at full gallop!"
A whirlwind of dust rose, enveloping men and horses, who
disappeared on the horizon. Two days later, a young lady on
horseback was riding by the side of a litter carried by two mules, in
which lay an old man, and a military surgeon and fifty lanceros
escorted them. They were Maria de Soto-Mayor, the general her
father, and the doctor, who were proceeding to Santiago.

CHAPTER XXXI.

THE CAMP OF THE MOLUCHOS


When Tahi-Mari reached the council lodge, the great Molucho chiefs
were already assembled. A compact crowd of Indian warriors silently
surrounded the approaches of the lodge, and pressed forward to
hear the resolutions which were going to be formed by the Ulmens.
On perceiving the formidable toqui of the Moluchos, the warriors
respectfully fell back to let him pass, and Tahi-Mari entered the hut.
His face was haughty and frowning, and everything about him
indicated pride and resolution. He sat down on the trunk of a tree
reserved for him, and which enabled him to survey the assembly.
After looking round him for a moment, he began to speak—
"For what purpose have my brothers, the Ulmens of the twelve
nations, assembled?" he asked.
"The pale-faces," Huachacuyac replied, "have sent two great chiefs
to discuss peace with us."
"The Spaniards," Tahi-Mari continued, "have two tongues and two
faces. My brothers must be on their guard, for they wish to deceive
them by false promises, while they are preparing the means to
destroy them."
"Matai," said the Ulmens, "our brother is learned: he is a great
warrior; he will judge."
"What is the opinion of my brothers? We cannot refuse to receive
the messengers of peace," Huachacuyac remarked.
"My brothers speak wisely: let the Spanish chiefs be brought in, and
we will hear them."
A movement took place among the Indians; Shounon-Kouiretzi went
in for a moment, and returned almost immediately, conducting
General Don Pedro Sallazar and Colonel Don Juan de Soto-Mayor.
They were unarmed, but their bold bearing and haughty brow
showed that they did not experience the slightest fear at finding
themselves at the mercy of their barbarous enemies.
A dozen lanceros, unarmed like them, halted at the lodge-door.
Shounon-Kouiretzi motioned the two officers to sit down on trunks of
trees not so high as the one employed by the chief, then after
lighting a calumet, he handed it to Tahi-Mari, who smoked it for an
instant and restored it to him. The latter then presented it to Don
Pedro Sallazar, who passed it to Don Juan. The calumet soon went
the round of the assembly and returned to Tahi-Mari, who finished it.
After this the toqui threw the ashes towards the strangers, saying, in
a loud voice—
"These chiefs and the soldiers who accompany them are the guests
of the Ulmens of the twelve Molucho nations: the warriors will
respect them till sunset."
This ceremony performed, there was a profound silence.
"What do the Spanish warriors desire?" Tahi-Mari at length said; "the
white chiefs can speak, for the ears of my brothers the Ulmens are
open."
Don Pedro Sallazar rose and said in Indian, a language which he
spoke with considerable facility—
"Grand Ulmens of the twelve nations, you, oh formidable toqui, and
all you red warriors who are listening to me, your great white father
sends me to you; his heart bleeds at seeing the numberless
misfortunes which war has caused; his ears are filled with the
complaints of mothers reduced to despair and of children who are
weeping for their fathers killed in action. The country is devastated,
the towns are only piles of ashes, and the rivers and streams whose
waters were so limpid are now corrupted and fetid with the number
of corpses they bear along. His mind being saddened by these
terrible calamities, and wishing at length to restore tranquillity and
abundance to this unhappy land, your great white father asks of you
through my voice that the axe should be buried between us, peace
be re-established among us, and the redskins and palefaces
henceforth form one united nation. Let my red brothers reflect: I
have spoken."
Don Pedro Sallazar sat down again, and Tahi-Mari immediately
replied—
"The Ulmens of the twelve great nations have never desired war;
they have avoided it as long as they could, and now endure it. It is
not the Molucho nation that dug up the hatchet. It is now three
hundred years since the Spaniards landed in our country. Our tribes
had no liberty upon the seashore, but the palefaces pursued them as
if they had been like wild beasts, and compelled them to take refuge
in the deserts of the Andes. Why, after tearing from the poor Indians
the fertile and sunlit lands which they possessed, are they now
trying to rob them of the uncultivated plains and reduce them to
slavery? Why do they wish to destroy their religion, and their laws,
and drive them into the eternal snows? Are not the Indians and
Spaniards sons of the same Father? Do not the priests of the
palefaces themselves say so? Let my brother the Spanish chief
answer."
"Yes," said Don Pedro, rising, "the great chief of the Moluchos is
right; but why renew old quarrels and revive ancient animosities? Is
not the country vast enough to support us all? Why should we not
live in peace together, each following our laws and professing our
religion? We are ready to grant our Indian brothers all they ask that
is just and equitable. I have come here to listen to the propositions
of the Ulmens, and the great Spanish chief will ratify them if they
are reasonable."
"It is too late," Tahi-Mari replied, rising in his turn; "the Moluchos are
resolved to regain their liberty, which was unjustly torn from them;
they are tired of living like wretched vagabonds on the snow-covered
mountains; now that they have descended into the plains warmed
by the sunshine they do not wish to leave them."
"The Ulmens will reflect," Don Pedro resumed. "They must not let
themselves be led astray by a slight success; the Spaniards are
powerful, and victory has ever been on their side up to this day."
"And then, too," said Don Juan, rising in his turn, "what do you hope
to obtain? Do you fancy yourselves sufficiently strong, even if you
succeed in capturing Santiago, to contend against the immense
forces which will come to crush you from the other side of the Great
Salt Lake? No; the war you are waging is a senseless war, without
any possible object or result. Commenced under the persuasion of
an ambitious chief, who employs you to carry out schemes of which
you are ignorant, you are only instruments in his hands. Believe my
words and those of General Sallazar; accept the frank and loyal
peace which we propose to you. This man, whom you have
appointed your toqui, is abusing you and deceiving you, and driving
you towards an abyss into which you will fall if you do not listen to
the voice of reason, which addresses you through our lips."
A lengthened tumult and menacing effervescence followed these
remarks of the young man. The chiefs anxiously questioned each
other in a low voice. Don Juan's bold language had produced a
certain impression on them, and some of them recognised its
correctness. Tahi-Mari alone remained impassive; not a muscle of his
face had moved, and the trace of any emotion might be sought in
vain upon his countenance. When the effect produced by Don Juan's
speech was slightly calmed, he rose, and giving his foe an ironical
glance, he said—
"The young Spanish chief has spoken well, and if he does not count
many years he has a great deal of wisdom. Peace is good when
loyally offered."
"And we do offer it loyally," Don Juan remarked eagerly.
"Ah! my brother must pardon me," Tahi-Mari said, with a sarcastic
smile.
"That demon is meditating some roguery," Don Pedro said, in a low
voice, to his companion; "we must be on our guard."
"My brothers the Ulmens," Diego continued, "have heard the words
pronounced by the two Spanish chiefs, and if they were really the
expression of their thoughts I would join my voice to theirs in urging
you to accept the peace they offer; but unfortunately here is a proof
of the bad faith which regulates their conduct."
Tahi-Mari drew from under his poncho a paper, which he slowly
unfolded, while a quiver of curiosity ran along the ranks of the
Indians, and the two Spanish officers exchanged glances in which
anxiety was visible.
"This despatch, my brothers, was found this very day upon a
Spanish soldier, who was the bearer of it. My brothers, the Ulmens,
will listen to me as I read it; and then see the amount of confidence
which they ought to place in the sincerity of our enemies."
"We are listening;" the Ulmens said.
"This is it," Diego remarked, and read:
"'My dear General,—The Indians are pressing us closely, and have
placed us in a most precarious position; still I hope to gain a few
days by making them proposals of peace, which will have no result,
as you can easily imagine; but will give the reinforcements you
announce to me time to come up. Do not delay, for I am anxious to
deal a decisive blow, and drive the rebels for ever from these parts.'"
"This letter, signed by the President of the Republic, is addressed to
the general commanding the province of Coquimbo. My brother can
consult: I have spoken," and Tahi-Mari resumed his seat.
A movement of fury seized the Ulmens, who rushed on the Spanish
officers with the intention of tearing them to pieces.
"Back, all of you," Tahi-Mari shouted in a thundering voice, "these
men are inviolable!"
The Indian stopped as if by enchantment.
"The word of an Ulmen is sacred," the half-breed continued. "Let
these chiefs return to the lodges of their white brothers; my brothers
will show these perfidious Spaniards that the great chiefs of the
twelve Molucho nations are as merciful as they are powerful."
Don Pedro and Don Juan, after escaping the peril that menaced
them, prepared to depart.
"A moment," said Tahi-Mari; "you will not leave the camp alone;
follow me."
And leaving the council lodge, he pointed towards his wigwam, in
front of the two officers and their escort of lanceros, who had
awaited them at the door.
On reaching the door of his abode, Diego went in, but came out
again almost immediately, holding by the hand a veiled female.
"There," he said, addressing Don Juan, "take away this girl, who
wearies me, and whose verses no longer possess any charms for
me; perhaps she will succeed in pleasing some of the soldiers, for
she is Spanish."
Then with a rapid movement he tore off the veil that concealed the
prisoner's features, and pushed her towards the officers.
"Inez!" the latter exclaimed, in horror.
It was indeed Inez; though not to be recognized by others but them,
as her face had assumed so strange an expression, and her eyes
were wandering. She turned her head in all directions, looking
stupidly around her, and then suddenly folding her arms on her
chest, she sang with an accent of ineffable sadness the following
lines from an old dance song:—
"From the corner,
From the corner of the Carmen
To the rock,
To the golden rock,
I have seen a,
I have seen a girl descend,
Singing,
Singing the Sambacueca."
"Oh!" Don Juan murmured in despair; "great Heaven, she is mad."
"And I have not even a sword," Don Pedro exclaimed, wringing his
hands furiously.
"Ah, Don Juan de Soto-Mayor, you did not expect I fancy, to find
your sister in Tahi-Mari's lodge? Take her back, while awaiting the
end of my vengeance; for, as I told you, I do not wish to have
anything more to do with her; and you, Señor Don Pedro, are you
not her assumed husband?"
"Wretch! why did I not listen to the feeling of aversion, with which
you inspired me, when I saw you at the house of General Soto-
Mayor? I ought to have killed you before you made me fall into the
trap which you and your gang laid for us in offering to escort us."
"Coward!" Don Juan said in his turn, his eyes full of tears; "kill the
brother after dishonouring the sister, for I hate you and defy you."
And, raising his hand, he sprang forward to strike Diego on the face;
but the latter at once guessing the young man's intention, seized his
arm and held him as in a vice.
"I need but to give a signal, and your head and that of your
companion roll at your feet; but I will not give it."
And with a sudden push he threw Don Juan far from him.
"Begone," he said coldly, "for no one will touch your person, which is
sacred to all in this camp, our two families no longer reckon insults
and wrongs, Don Juan, and this one will be requited with the rest."
During this time poor Inez, apparently not noticing what was going
on, was crouching in a corner, and with her head in her hands and
her long hair covering her face, was humming in a low voice a hymn
to the Virgin. Without making any reply to Diego the young men
walked up to Inez and made her rise. She offered no resistance, but
continued to sing—
"'The birds in the sky,
The fishes of the sea,
The wild beasts of the forests,
Celebrate her glory.'"
"What is the matter, Señor Caballero?" she suddenly asked, as she
broke off her chant and looked at her brother, "you appear sad.
Would you like me to sing you a pretty sequidilla?"
"'Señorita, señorita,
Raise your little foot.'"
"Oh," said Don Juan, "what madness! Inez, my sister, recognise me.
I am Juanito, your brother, whom you love so dearly."
A flash of intelligence passed into the maiden's eyes, and a smile
played round her lips.
"Juanito!" she said. "Yes, yes," she exclaimed clapping her hands,
"listen—"
"'Juanito is a brave,
A brave whom I love,
A handsome fellow dressed,
All in cloth—"
A hoarse burst of laughter interrupted the song.
"Why try to arouse her memory?" Tahi-Mari said, with a shrug of the
shoulders.
"Oh!" Don Juan exclaimed, turning to him, "all your blood will not
suffice to avenge us."
"As you please, caballero: but in the meanwhile be off, or I cannot
answer for your safety."
"Not yet," said a thundering voice, which vibrated through the air.
A great disturbance broke out in camp, and a man covered with
perspiration and dust proceeded towards Tahi-Mari's hut. It was
Captain Leon Delbès, on seeing whom Diego turned pale, but
remained motionless. Leon advanced toward him thrusting aside
every obstacle that barred his progress.
"What have you done with General Soto-Mayor's daughter?" he
asked, fixing his eyes on the half-breed's.
The smuggler's entrance had been so unexpected, his action so
extraordinarily rash, that all the Indians who witnessed the scene
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like