100% found this document useful (1 vote)
16 views

Starting Out with C From Control Structures through Objects 7th Edition Edition Tony Gaddis pdf download

The document provides information about the book 'Starting Out with C++ From Control Structures through Objects 7th Edition' by Tony Gaddis, including details about its content, chapters, and ISBN numbers. It also offers links to download the book and other related titles by the same author. The book covers fundamental programming concepts and C++ language features, making it suitable for beginners.

Uploaded by

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

Starting Out with C From Control Structures through Objects 7th Edition Edition Tony Gaddis pdf download

The document provides information about the book 'Starting Out with C++ From Control Structures through Objects 7th Edition' by Tony Gaddis, including details about its content, chapters, and ISBN numbers. It also offers links to download the book and other related titles by the same author. The book covers fundamental programming concepts and C++ language features, making it suitable for beginners.

Uploaded by

labucaegry
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/ 54

Starting Out with C From Control Structures

through Objects 7th Edition Edition Tony Gaddis


pdf download

https://ebookfinal.com/download/starting-out-with-c-from-control-
structures-through-objects-7th-edition-edition-tony-gaddis/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

Starting Out with C Early Objects 5th Edition Tony Gaddis

https://ebookfinal.com/download/starting-out-with-c-early-objects-5th-
edition-tony-gaddis/

Starting out with Visual C 2012 with CD Rom 3rd Edition


Tony Gaddis

https://ebookfinal.com/download/starting-out-with-visual-c-2012-with-
cd-rom-3rd-edition-tony-gaddis/

Starting Out With App Inventor for Android 1st Edition


Tony Gaddis

https://ebookfinal.com/download/starting-out-with-app-inventor-for-
android-1st-edition-tony-gaddis/

Starting Out the English Starting Out Everyman Chess 1st


Edition Neil Mcdonald

https://ebookfinal.com/download/starting-out-the-english-starting-out-
everyman-chess-1st-edition-neil-mcdonald/
Starting Out Dutch Defence Starting Out Everyman Chess 1st
Edition Neil Macdonald

https://ebookfinal.com/download/starting-out-dutch-defence-starting-
out-everyman-chess-1st-edition-neil-macdonald/

Starting Out Attacking Play Starting Out Everyman Chess


1st Edition James Plaskett

https://ebookfinal.com/download/starting-out-attacking-play-starting-
out-everyman-chess-1st-edition-james-plaskett/

Data Structures and Other Objects Using C 4th Edition Main

https://ebookfinal.com/download/data-structures-and-other-objects-
using-c-4th-edition-main/

Starting Out in Bridge 1st Edition Paul Lamford

https://ebookfinal.com/download/starting-out-in-bridge-1st-edition-
paul-lamford/

Starting Out Defensive Play 1st Edition Angus Dunnington

https://ebookfinal.com/download/starting-out-defensive-play-1st-
edition-angus-dunnington/
Starting Out with C From Control Structures through
Objects 7th Edition Edition Tony Gaddis Digital Instant
Download
Author(s): Tony Gaddis
ISBN(s): 9780132576253, 0132576252
Edition: 7th Edition
File Details: PDF, 53.69 MB
Year: 2011
Language: english
get with the programming

Through the power of practice and immediate personalized


feedback, MyProgrammingLab improves your performance.

Learn more at www.myprogramminglab.com


STARTING OUT WITH

C++
From Control Structures
through Objects
SEVENTH EDITION

Tony Gaddis
Haywood Community College

Addison-Wesley
Boston Columbus Indianapolis New York San Francisco Upper Saddle River
Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal Toronto
Delhi Mexico City Sao Paulo Sydney Hong Kong Seoul Singapore Taipei Tokyo
Editorial Director: Marcia Horton Manufacturing Buyer: Lisa McDowell
Editor-in-Chief: Michael Hirsch Art Director: Linda Knowles
Editorial Assistant: Stephanie Sellinger Cover Designer: Joyce Cosentino Wells
Vice President, Marketing: Patrice Jones Cover Image: © Fotosearch/Rubberball Photos
Marketing Manager: Yezan Alayan Media Editor: Daniel Sandin
Marketing Coordinator: Kathryn Ferranti Media Project Manager: Wanda Rockwell
Vice President, Production: Vince O Brien Full-Service Vendor: Aptara®, Inc.
Managing Editor: Jeff Holcomb Project Management: Dennis Free/Aptara®, Inc.
Senior Production Project Manager: Marilyn Lloyd Printer/Binder: Edwards Brothers
Senior Operations Supervisor: Alan Fischer Cover Printer: Lehigh-Phoenix Color

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

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

Library of Congress Cataloging-in-Publication Data

Gaddis, Tony.
Starting out with C++ : from control structures through objects / Tony
Gaddis. 7th ed.
p. cm.
Includes bibliographical references and index.
ISBN-13: 978-0-13-257625-3 (alk. paper)
ISBN-10: 0-13-257625-2 (alk. paper)
1. C++ (Computer program language) I. Title.
QA76.73.C153G33 2012
005.13'3 dc22
2011003252

10 9 8 7 6 5 4 3 2 1 EB 15 14 13 12 11

ISBN 13: 978-0-13-257625-3


ISBN 10: 0-13-257625-2
Contents at a Glance

Preface xiii
CHAPTER 1 Introduction to Computers and Programming 1
CHAPTER 2 Introduction to C++ 27
CHAPTER 3 Expressions and Interactivity 85
CHAPTER 4 Making Decisions 149
CHAPTER 5 Loops and Files 227
CHAPTER 6 Functions 301
CHAPTER 7 Arrays 377
CHAPTER 8 Searching and Sorting Arrays 451
CHAPTER 9 Pointers 491
CHAPTER 10 Characters, C-Strings, and More About the String Class 541
CHAPTER 11 Structured Data 593
CHAPTER 12 Advanced File Operations 651
CHAPTER 13 Introduction to Classes 705
CHAPTER 14 More About Classes 799
CHAPTER 15 Inheritance, Polymorphism, and Virtual Functions 869
CHAPTER 16 Exceptions, Templates, and the Standard Template Library (STL) 947
CHAPTER 17 Linked Lists 1003
CHAPTER 18 Stacks and Queues 1043
CHAPTER 19 Recursion 1101
CHAPTER 20 Binary Trees 1137

Appendix A: Getting Started with Alice 1167


Appendix B: The ASCII Character Set 1195
Appendix C: Operator Precedence and Associativity 1197
Quick References 1199
Index 1201

v
vi Contents at a Glance

Online The following appendices are available at www.pearsonhighered.com/gaddis.


Appendix D: Introduction to Flowcharting
Appendix E: Using UML in Class Design
Appendix F: Namespaces
Appendix G: Writing Managed C++ Code for the .NET Framework
Appendix H: Passing Command Line Arguments
Appendix I: Header File and Library Function Reference
Appendix J: Binary Numbers and Bitwise Operations
Appendix K: Multi-Source File Programs
Appendix L: Stream Member Functions for Formatting
Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition
Appendix N: Answers to Checkpoints
Appendix O: Solutions to Odd-Numbered Review Questions
Contents

Preface xiii

CHAPTER 1 Introduction to Computers and Programming 1


1.1 Why Program? 1
1.2 Computer Systems: Hardware and Software 3
1.3 Programs and Programming Languages 8
1.4 What Is a Program Made of? 13
1.5 Input, Processing, and Output 17
1.6 The Programming Process 18
1.7 Procedural and Object-Oriented Programming 22

CHAPTER 2 Introduction to C++ 27


2.1 The Parts of a C++ Program 27
2.2 The cout Object 31
2.3 The #include Directive 36
2.4 Variables and Literals 37
2.5 Identifiers 41
2.6 Integer Data Types 42
2.7 The char Data Type 47
2.8 The C++ string Class 51
2.9 Floating-Point Data Types 53
2.10 The bool Data Type 56
2.11 Determining the Size of a Data Type 57
2.12 Variable Assignments and Initialization 58
2.13 Scope 59
2.14 Arithmetic Operators 60
2.15 Comments 68
2.16 Named Constants 70
2.17 Programming Style 72
2.18 If You Plan to Continue in Computer Science: Standard and Prestandard C++ 74

vii
viii Contents

CHAPTER 3 Expressions and Interactivity 85


3.1 The cin Object 85
3.2 Mathematical Expressions 91
3.3 When You Mix Apples and Oranges: Type Conversion 100
3.4 Overflow and Underflow 102
3.5 Type Casting 103
3.6 Multiple Assignment and Combined Assignment 107
3.7 Formatting Output 111
3.8 Working with Characters and string Objects 120
3.9 More Mathematical Library Functions 127
3.10 Focus on Debugging: Hand Tracing a Program 130
3.11 Focus on Problem Solving: A Case Study 132

CHAPTER 4 Making Decisions 149


4.1 Relational Operators 149
4.2 The if Statement 154
4.3 Expanding the if Statement 162
4.4 The if/else Statement 166
4.5 Nested if Statements 169
4.6 The if/else if Statement 176
4.7 Flags 181
4.8 Logical Operators 182
4.9 Checking Numeric Ranges with Logical Operators 189
4.10 Menus 190
4.11 Focus on Software Engineering: Validating User Input 193
4.12 Comparing Characters and Strings 195
4.13 The Conditional Operator 199
4.14 The switch Statement 202
4.15 More About Blocks and Scope 211

CHAPTER 5 Loops and Files 227


5.1 The Increment and Decrement Operators 227
5.2 Introduction to Loops: The while Loop 232
5.3 Using the while Loop for Input Validation 239
5.4 Counters 241
5.5 The do-while Loop 242
5.6 The for Loop 247
5.7 Keeping a Running Total 257
5.8 Sentinels 260
5.9 Focus on Software Engineering: Deciding Which Loop to Use 261
5.10 Nested Loops 262
5.11 Using Files for Data Storage 265
5.12 Optional Topics: Breaking and Continuing a Loop 285

CHAPTER 6 Functions 301


6.1 Focus on Software Engineering: Modular Programming 301
6.2 Defining and Calling Functions 303
6.3 Function Prototypes 311
6.4 Sending Data into a Function 313
Contents ix

6.5 Passing Data by Value 318


6.6 Focus on Software Engineering: Using Functions in a Menu-Driven Program 320
6.7 The return Statement 324
6.8 Returning a Value from a Function 326
6.9 Returning a Boolean Value 334
6.10 Local and Global Variables 336
6.11 Static Local Variables 344
6.12 Default Arguments 347
6.13 Using Reference Variables as Parameters 350
6.14 Overloading Functions 356
6.15 The exit() Function 360
6.16 Stubs and Drivers 363

CHAPTER 7 Arrays 377


7.1 Arrays Hold Multiple Values 377
7.2 Accessing Array Elements 379
7.3 No Bounds Checking in C++ 386
7.4 Array Initialization 389
7.5 Processing Array Contents 394
7.6 Focus on Software Engineering: Using Parallel Arrays 402
7.7 Arrays as Function Arguments 405
7.8 Two-Dimensional Arrays 416
7.9 Arrays with Three or More Dimensions 423
7.10 Focus on Problem Solving and Program Design: A Case Study 424
7.11 If You Plan to Continue in Computer Science: Introduction to the
STL vector 427

CHAPTER 8 Searching and Sorting Arrays 451


8.1 Focus on Software Engineering: Introduction to Search Algorithms 451
8.2 Focus on Problem Solving and Program Design: A Case Study 458
8.3 Focus on Software Engineering: Introduction to Sorting Algorithms 464
8.4 Focus on Problem Solving and Program Design: A Case Study 472
8.5 If You Plan to Continue in Computer Science: Sorting and
Searching vectors 480

CHAPTER 9 Pointers 491


9.1 Getting the Address of a Variable 491
9.2 Pointer Variables 493
9.3 The Relationship Between Arrays and Pointers 500
9.4 Pointer Arithmetic 504
9.5 Initializing Pointers 506
9.6 Comparing Pointers 507
9.7 Pointers as Function Parameters 509
9.8 Focus on Software Engineering: Dynamic Memory Allocation 518
9.9 Focus on Software Engineering: Returning Pointers from Functions 522
9.10 Focus on Problem Solving and Program Design: A Case Study 529

CHAPTER 10 Characters, C-Strings, and More About the string Class 541
10.1 Character Testing 541
10.2 Character Case Conversion 545
x Contents

10.3 C-Strings 548


10.4 Library Functions for Working with C-Strings 552
10.5 C-String/Numeric Conversion Functions 563
10.6 Focus on Software Engineering: Writing Your Own
C-String-Handling Functions 568
10.7 More About the C++ string Class 574
10.8 Focus on Problem Solving and Program Design: A Case Study 584

CHAPTER 11 Structured Data 593


11.1 Abstract Data Types 593
11.2 Focus on Software Engineering: Combining Data
into Structures 595
11.3 Accessing Structure Members 598
11.4 Initializing a Structure 602
11.5 Arrays of Structures 605
11.6 Focus on Software Engineering: Nested Structures 608
11.7 Structures as Function Arguments 612
11.8 Returning a Structure from a Function 615
11.9 Pointers to Structures 618
11.10 Focus on Software Engineering: When to Use ., When to Use ->,
and When to Use * 621
11.11 Unions 623
11.12 Enumerated Data Types 627

CHAPTER 12 Advanced File Operations 651


12.1 File Operations 651
12.2 File Output Formatting 658
12.3 Passing File Stream Objects to Functions 660
12.4 More Detailed Error Testing 662
12.5 Member Functions for Reading and Writing Files 665
12.6 Focus on Software Engineering: Working with Multiple Files 672
12.7 Binary Files 674
12.8 Creating Records with Structures 679
12.9 Random-Access Files 683
12.10 Opening a File for Both Input and Output 691

CHAPTER 13 Introduction to Classes 705


13.1 Procedural and Object-Oriented Programming 705
13.2 Introduction to Classes 712
13.3 Defining an Instance of a Class 717
13.4 Why Have Private Members? 728
13.5 Focus on Software Engineering: Separating Class Specification
from Implementation 729
13.6 Inline Member Functions 735
13.7 Constructors 738
13.8 Passing Arguments to Constructors 742
13.9 Destructors 750
13.10 Overloading Constructors 754
13.11 Private Member Functions 758
13.12 Arrays of Objects 759
Contents xi

13.13 Focus on Problem Solving and Program Design: An OOP Case Study 763
13.14 Focus on Object-Oriented Programming: Creating an Abstract Array
Data Type 770
13.15 Focus on Object-Oriented Design: The Unified Modeling Language (UML) 774
13.16 Focus on Object-Oriented Design: Finding the Classes and Their
Responsibilities 777

CHAPTER 14 More About Classes 799


14.1 Instance and Static Members 799
14.2 Friends of Classes 807
14.3 Memberwise Assignment 812
14.4 Copy Constructors 813
14.5 Operator Overloading 819
14.6 Object Conversion 846
14.7 Aggregation 849
14.8 Focus on Object-Oriented Design: Class Collaborations 853

CHAPTER 15 Inheritance, Polymorphism, and Virtual Functions 869


15.1 What Is Inheritance? 869
15.2 Protected Members and Class Access 878
15.3 Constructors and Destructors in Base and Derived Classes 884
15.4 Redefining Base Class Functions 896
15.5 Class Hierarchies 901
15.6 Polymorphism and Virtual Member Functions 907
15.7 Abstract Base Classes and Pure Virtual Functions 921
15.8 Multiple Inheritance 928

CHAPTER 16 Exceptions, Templates, and the Standard Template Library (STL) 947
16.1 Exceptions 947
16.2 Function Templates 966
16.3 Focus on Software Engineering: Where to Start When Defining Templates 972
16.4 Class Templates 973
16.5 Introduction to the Standard Template Library (STL) 983

CHAPTER 17 Linked Lists 1003


17.1 Introduction to the Linked List ADT 1003
17.2 Linked List Operations 1005
17.3 A Linked List Template 1022
17.4 Variations of the Linked List 1034
17.5 The STL list Container 1035

CHAPTER 18 Stacks and Queues 1043


18.1 Introduction to the Stack ADT 1043
18.2 Dynamic Stacks 1060
18.3 The STL stack Container 1071
18.4 Introduction to the Queue ADT 1073
18.5 Dynamic Queues 1085
18.6 The STL deque and queue Containers 1092
xii Contents

CHAPTER 19 Recursion 1101


19.1 Introduction to Recursion 1101
19.2 Solving Problems with Recursion 1106
19.3 Focus on Problem Solving and Program Design: The Recursive
gcd Function 1113
19.4 Focus on Problem Solving and Program Design: Solving Recursively
Defined Problems 1114
19.5 Focus on Problem Solving and Program Design: Recursive Linked
List Operations 1116
19.6 Focus on Problem Solving and Program Design: A Recursive Binary
Search Function 1119
19.7 The Towers of Hanoi 1122
19.8 Focus on Problem Solving and Program Design: The QuickSort Algorithm 1125
19.9 Exhaustive Algorithms 1130
19.10 Focus on Software Engineering: Recursion vs. Iteration 1132

CHAPTER 20 Binary Trees 1137


20.1 Definition and Applications of Binary Trees 1137
20.2 Binary Search Tree Operations 1140
20.3 Template Considerations for Binary Search Trees 1157

Appendix A: Getting Started with Alice 1167


Appendix B: The ASCII Character Set 1195
Appendix C: Operator Precedence and Associativity 1197
Quick References 1199
Index 1201

Online The following appendices are available at www.pearsonhighered.com/gaddis.


Appendix D: Introduction to Flowcharting
Appendix E: Using UML in Class Design
Appendix F: Namespaces
Appendix G: Writing Managed C++ Code for the .NET Framework
Appendix H: Passing Command Line Arguments
Appendix I: Header File and Library Function Reference
Appendix J: Binary Numbers and Bitwise Operations
Appendix K: Multi-Source File Programs
Appendix L: Stream Member Functions for Formatting
Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition
Appendix N: Answers to Checkpoints
Appendix O: Solutions to Odd-Numbered Review Questions
Preface

Welcome to Starting Out with C++: From Control Structures through Objects, 7th edi-
tion. This book is intended for use in a two-semester C++ programming sequence, or an
accelerated one-semester course. Students new to programming, as well as those with
prior course work in other languages, will nd this text bene cial. The fundamentals of
programming are covered for the novice, while the details, pitfalls, and nuances of the
C++ language are explored in-depth for both the beginner and more experienced student.
The book is written with clear, easy-to-understand language and it covers all the necessary
topics for an introductory programming course. This text is rich in example programs that
are concise, practical, and real-world oriented, ensuring that the student not only learns
how to implement the features and constructs of C++, but why and when to use them.

Changes in the Seventh Edition


This book s pedagogy, organization, and clear writing style remain the same as in the pre-
vious edition. Many improvements have been made, which are summarized here:
This edition uses string objects, instead of char arrays, as the preferred way to
store strings. This change has been made throughout the entire book. A thorough
discussion of C-strings and the technique of storing them in char arrays is pro-
vided as a topic in Chapter 10.
All of the introductory file I/O material has been consolidated and moved to
Chapter 5. In previous editions, this material was gradually introduced in Chap-
ters 3 through 5. Many reviewers requested that all the material be given in one
place, after loops have been covered.
Named constants are now introduced in Chapter 2, after variables.
In Chapter 2 an additional In the Spotlight section demonstrating the modulus
operator has been added.
Chapter 4 has been reorganized so that all the fundamental decision structure
topics appear early in the chapter.
A discussion of passing arrays using const references has been added to Chapter 7.

xiii
xiv Preface

An In the Spotlight section giving an additional example of inheritance has been


added to Chapter 15.
Template examples for stacks, queues, and binary search trees have been added to
Chapters 18 and 20.
The Serendipity Booksellers project has been moved to the book s online resource
page at www.pearsonhighered.com/gaddis.

Organization of the Text


This text teaches C++ in a step-by-step fashion. Each chapter covers a major set of topics
and builds knowledge as the student progresses through the book. Although the chapters
can be easily taught in their existing sequence, some exibility is provided. The diagram
shown in Figure P-1 suggests possible sequences of instruction.
Chapter 1 covers fundamental hardware, software, and programming concepts. You may
choose to skip this chapter if the class has already mastered those topics. Chapters 2
through 7 cover basic C++ syntax, data types, expressions, selection structures, repetition
structures, functions, and arrays. Each of these chapters builds on the previous chapter
and should be covered in the order presented.
After Chapter 7 has been covered, you may proceed to Chapter 8, or jump to either Chap-
ter 9 or Chapter 12. (If you jump to Chapter 12 at this point, you will need to postpone
sections 12.7, 12.8, and 12.10 until Chapters 9 and 11 have been covered.)
After Chapter 9 has been covered, either of Chapters 10 or 11 may be covered. After
Chapter 11, you may cover Chapters 13 through 17 in sequence. Next you can proceed to
either Chapter 18 or Chapter 19. Finally, Chapter 20 may be covered.
This text s approach starts with a rm foundation in structured, procedural programming
before delving fully into object-oriented programming and advanced data structures.

Brief Overview of Each Chapter

Chapter 1: Introduction to Computers and Programming


This chapter provides an introduction to the eld of computer science and covers the funda-
mentals of programming, problem solving, and software design. The components of pro-
grams, such as key words, variables, operators, and punctuation are covered. The tools of
the trade, such as pseudocode, ow charts, and hierarchy charts are also presented.

Chapter 2: Introduction to C++


This chapter gets the student started in C++ by introducing data types, identi ers, variable
declarations, constants, comments, program output, simple arithmetic operations, and C-
strings. Programming style conventions are introduced and good programming style is
modeled here, as it is throughout the text. An optional section explains the difference
between ANSI standard and pre-standard C++ programs.
Preface xv

Figure P-1

Chapter 1
Introduction

Chapters 2 7
Basic Language
Elements

Chapter 8 Chapter 9 Chapter 12


Searching And Pointers Advanced File
Sorting Arrays Operations*

*A few subtopics in
Chapter 12 require
Chapter 10 Chapters 9 and 11.
Characters, Strings, Chapter 11
and the string Class Structures

Chapter 13
Introduction to
Classes

Chapter 14
More About Classes

Chapter 15
Inheritance and
Polymorphism

Chapter 16
Exceptions,
Templates, and STL

Chapter 17
Linked Lists

Chapter 18 Chapter 19
Stacks and Queues Recursion

Chapter 20
Binary Trees
xvi Preface

Chapter 3: Expressions and Interactivity


In this chapter the student learns to write programs that input and handle numeric, char-
acter, and string data. The use of arithmetic operators and the creation of mathematical
expressions are covered in greater detail, with emphasis on operator precedence. Debug-
ging is introduced, with a section on hand tracing a program. Sections are also included
on simple output formatting, on data type conversion and type casting, and on using
library functions that work with numbers.

Chapter 4: Making Decisions


Here the student learns about relational operators, relational expressions and how to con-
trol the ow of a program with the if, if/else, and if/else if statements. The condi-
tional operator and the switch statement are also covered. Crucial applications of these
constructs are covered, such as menu-driven programs and the validation of input.

Chapter 5: Loops and Files


This chapter covers repetition control structures. The while loop, do-while loop, and for
loop are taught, along with common uses for these devices. Counters, accumulators, run-
ning totals, sentinels, and other application-related topics are discussed. Sequential le I/O is
also introduced. The student learns to read and write text les, and use loops to process the
data in a le.

Chapter 6: Functions
In this chapter the student learns how and why to modularize programs, using both void
and value returning functions. Argument passing is covered, with emphasis on when argu-
ments should be passed by value versus when they need to be passed by reference. Scope
of variables is covered and sections are provided on local versus global variables and on
static local variables. Overloaded functions are also introduced and demonstrated.

Chapter 7: Arrays
In this chapter the student learns to create and work with single and multidimensional
arrays. Many examples of array processing are provided including examples illustrating
how to nd the sum, average, highest and lowest values in an array and how to sum the
rows, columns, and all elements of a two-dimensional array. Programming techniques using
parallel arrays are also demonstrated and the student is shown how to use a data le as an
input source to populate an array. STL vectors are introduced and compared to arrays.

Chapter 8: Sorting and Searching Arrays


Here the student learns the basics of sorting arrays and searching for data stored in them.
The chapter covers the Bubble Sort, Selection Sort, Linear Search, and Binary Search algo-
rithms. There is also a section on sorting and searching STL vector objects.
Preface xvii

Chapter 9: Pointers
This chapter explains how to use pointers. Pointers are compared to and contrasted with
reference variables. Other topics include pointer arithmetic, initialization of pointers, rela-
tional comparison of pointers, pointers and arrays, pointers and functions, dynamic mem-
ory allocation, and more.

Chapter 10: Characters, C-strings, and More About the string Class
This chapter discusses various ways to process text at a detailed level. Library functions
for testing and manipulating characters are introduced. C-strings are discussed, and the
technique of storing C-strings in char arrays is covered. An extensive discussion of the
string class methods is also given.

Chapter 11: Structured Data


The student is introduced to abstract data types and taught how to create them using struc-
tures, unions, and enumerated data types. Discussions and examples include using pointers
to structures, passing structures to functions, and returning structures from functions.

Chapter 12: Advanced File Operations


This chapter covers sequential access, random access, text, and binary les. The various
modes for opening les are discussed, as well as the many methods for reading and writing
le contents. Advanced output formatting is also covered.

Chapter 13: Introduction to Classes


The student now shifts focus to the object-oriented paradigm. This chapter covers the
fundamental concepts of classes. Member variables and functions are discussed. The
student learns about private and public access speci cations, and reasons to use each.
The topics of constructors, overloaded constructors, and destructors are also presented.
The chapter presents a section modeling classes with UML, and how to nd the classes
in a particular problem.

Chapter 14: More About Classes


This chapter continues the study of classes. Static members, friends, memberwise assign-
ment, and copy constructors are discussed. The chapter also includes in-depth sections on
operator overloading, object conversion, and object aggregation. There is also a section
on class collaborations and the use of CRC cards.

Chapter 15: Inheritance and Polymorphism


The study of classes continues in this chapter with the subjects of inheritance, polymor-
phism, and virtual member functions. The topics covered include base and derived class
constructors and destructors, virtual member functions, base class pointers, static and
dynamic binding, multiple inheritance, and class hierarchies.
xviii Preface

Chapter 16: Exceptions, Templates, and the Standard


Template Library (STL)
The student learns to develop enhanced error trapping techniques using exceptions. Dis-
cussion then turns to function and class templates as a method for reusing code. Finally,
the student is introduced to the containers, iterators, and algorithms offered by the Stan-
dard Template Library (STL).

Chapter 17: Linked Lists


This chapter introduces concepts and techniques needed to work with lists. A linked list
ADT is developed and the student is taught to code operations such as creating a linked
list, appending a node, traversing the list, searching for a node, inserting a node, deleting a
node, and destroying a list. A linked list class template is also demonstrated.

Chapter 18: Stacks and Queues


In this chapter the student learns to create and use static and dynamic stacks and queues. The
operations of stacks and queues are de ned, and templates for each ADT are demonstrated.

Chapter 19: Recursion


This chapter discusses recursion and its use in problem solving. A visual trace of recursive
calls is provided and recursive applications are discussed. Many recursive algorithms are
presented, including recursive functions for nding factorials, nding a greatest common
denominator (GCD), performing a binary search, and sorting (QuickSort). The classic
Towers of Hanoi example is also presented. For students who need more challenge, there
is a section on exhaustive algorithms.

Chapter 20: Binary Trees


This chapter covers the binary tree ADT, and demonstrates many binary tree operations.
The student learns to traverse a tree, insert an element, delete an element, replace an ele-
ment, test for an element, and destroy a tree.

Appendix A: Getting Started with Alice


This appendix gives a quick introduction to Alice. Alice is free software that can be used
to teach fundamental programming concepts using 3D graphics.

Appendix B: ASCII Character Set


A list of the ASCII and Extended ASCII characters and their codes.

Appendix C: Operator Precedence and Associativity


A chart showing the C++ operators and their precedence.
Preface xix

The following appendices are available online at www.pearsonhighered.com/gaddis.

Appendix D: Introduction to Flowcharting


A brief introduction to owcharting. This tutorial discusses sequence, selection, case, rep-
etition, and module structures.

Appendix E: Using UML in Class Design


This appendix shows the student how to use the Uni ed Modeling Language to design
classes. Notation for showing access speci cation, data types, parameters, return values,
overloaded functions, composition, and inheritance are included.

Appendix F: Namespaces
This appendix explains namespaces and their purpose. Examples showing how to de ne a
namespace and access its members are given.

Appendix G: Writing Managed C++ Code for the .NET Framework


This appendix introduces the student to the concepts surrounding managed C++ in
Microsoft s .NET environment.

Appendix H: Passing Command Line Arguments


Teaches the student how to write a C++ program that accepts arguments from the com-
mand line. This appendix will be useful to students working in a command line environ-
ment, such as Unix, Linux, or the Windows command prompt.

Appendix I: Header File and Library Function Reference


This appendix provides a reference for the C++ library functions and header les discussed
in the book.

Appendix J: Binary Numbers and Bitwise Operations


A guide to the C++ bitwise operators, as well as a tutorial on the internal storage of integers.

Appendix K: Multi-Source File Programs


Provides a tutorial on creating programs that consist of multiple source les. Function
header les, class speci cation les, and class implementation les are discussed.

Appendix L: Stream Member Functions for Formatting


Covers stream member functions for formatting such as setf.

Appendix M: Introduction to Microsoft Visual C++ 2010 Express Edition


A tutorial on how to start a project in Microsoft Visual C++ 2010 Express Edition, com-
pile a program, save source les, and more.
Discovering Diverse Content Through
Random Scribd Documents
THE CITY IN RUINS.
Richard Spillane, a well-known Galveston newspaper man and
day correspondent of the Associated Press in that city, who reached
Houston September 10th, after a terrible experience, gives the
following account of the disaster at Galveston:

FIRST BAPTIST CHURCH, GALVESTON,


AFTER THE STORM

WRECKAGE OF CARS OF GRAIN—


GALVESTON
AVENUE L AND TWENTY-SIXTH STREET,
SHOWING THE URSULINE CONVENT, THE
REFUGE OF HUNDREDS OF PEOPLE

RUINS OF THE GAS WORKS AT THIRTY-


THIRD AND MARKET STREETS
BURYING BODIES WHERE THEY WERE
FOUND

AVENUE L AND FIFTEENTH STREET—


SHOWING DESTRUCTION DONE BY THE
HURRICANE
TANGLED MASS OF RUINS ON NINETEENTH
STREET

VOLUNTEERS REMOVING DEBRIS ON


TWENTY-FIRST STREET, LOOKING SOUTH

“One of the most awful tragedies of modern times has visited


Galveston. The city is in ruins, and the dead will number many
thousands: I am just from the city, having been commissioned by the
Mayor and Citizens’ Committee to get in touch with the outside
world and appeal for help. Houston was the nearest point at which
working telegraph instruments could be found, the wires as well as
nearly all the buildings between here and the Gulf of Mexico being
wrecked.
“When I left Galveston the people were organizing for the
prompt burial of the dead, distribution of food and all necessary
work after a period of disaster.
CITY TURNED INTO A RAGING SEA.
“The wreck of Galveston was brought about by a tempest so
terrible that no words can adequately describe its intensity, and by a
flood which turned the city into a raging sea. The Weather Bureau
records show that the wind attained a velocity of eighty-four miles an
hour when the measuring instrument blew away, so it is impossible
to tell what was the maximum.
“The storm began at 2 o’clock Saturday morning. Previous to
that a great storm had been raging in the Gulf, and the tide was very
high. The wind at first came from the north, and was in direct
opposition to the force from the Gulf. Where the storm in the Gulf
piled the water up on the beach side of the city, the north wind piled
the water from the bay onto the bay part of the city.
“About noon it became evident that the city was going to be
visited with disaster. Hundreds of residences along the beach front
were hurriedly abandoned, the families fleeing to dwellings in higher
portions of the city. Every home was opened to the refugees, black or
white. The winds were rising constantly, and it rained in torrents.
The wind was so fierce that the rain cut like a knife.
“By 3 o’clock the waters of the Gulf and bay met, and by dark the
entire city was submerged. The flooding of the electric light plant and
the gas plants left the city in darkness. To go upon the streets was to
court death. The wind was then at cyclonic velocity, roofs, cisterns,
portions of buildings, telegraph poles and walls were falling, and the
noise of the wind and the crashing of buildings were terrifying in the
extreme. The wind and waters rose steadily from dark until 1.45
o’clock Sunday morning. During all this time the people of Galveston
were like rats in a trap. The highest portion of the city was four to
five feet under water, while in the great majority of cases the streets
were submerged to a depth of ten feet. To leave a house was to
drown. To remain was to court death in the wreckage.
“Such a night of agony has seldom been equaled. Without
apparent reason the waters suddenly began to subside at 1.45 A. M.
Within twenty minutes they had gone down two feet, and before
daylight the streets were practically freed of the flood-waters. In the
meantime the wind had veered to the southeast.
VERY FEW BUILDINGS ESCAPED.
“Very few if any buildings escaped injury. There is hardly a
habitable dry house in the city. When the people who had escaped
death went out at daylight to view the work of the tempest and floods
they saw the most horrible sights imaginable. In the three blocks
from Avenue N to Avenue P, in Tremont street, I saw eight bodies.
Four corpses were in one yard.
“The whole of the business front for three blocks in from the
Gulf was stripped of every vestige of habitation, the dwellings, the
great bathing establishments, the Olympia and every structure
having been either carried out to sea or its ruins piled in a pyramid
far into the town, according to the vagaries of the tempest. The first
hurried glance over the city showed that the largest structures,
supposed to be the most substantially built, suffered the greatest.
“The Orphans’ Home, Twenty-first street and Avenue M, fell like
a house of cards. How many dead children and refugees are in the
ruins could not be ascertained. Of the sick in St. Mary’s Infirmary,
together with the attendants, only eight are understood to have been
saved. The Old Woman’s Home, on Roosenburg avenue, collapsed,
and the Roosenburg School-house is a mass of wreckage. The Ball
High School is but an empty shell, crushed and broken. Every church
in the city, with possibly one or two exceptions, is in ruins.
“At the forts nearly all the soldiers are reported dead, they
having been in temporary quarters, which gave them no protection
against the tempest or flood. No report has been received from the
Catholic Orphan Asylum down the island, but it seems impossible
that it could have withstood the hurricane. If it fell, all the inmates
were, no doubt, lost, for there was no aid within a mile.
“The bay front from end to end is in ruins. Nothing but piling
and the wreck of great warehouses remain. The elevators lost all their
super-works, and their stocks are damaged by water. The life-saving
station at Fort Point was carried away, the crew being swept across
the bay fourteen miles to Texas City. I saw Captain Haynes, and he
told me that his wife and one of his crew were drowned.
WRECKAGE SWEPT ACROSS THE BAY.
“The shore at Texas City contains enough wreckage to rebuild a
city. Eight persons who were swept across the bay during the storm
were picked up there alive. Five corpses were also picked up. There
were three fatalities in Texas City. In addition to the living and the
dead which the storm cast up at Texas City, caskets and coffins from
one of the cemeteries at Galveston were being fished out of the water
there yesterday. In the business portion of the city two large brick
buildings, one occupied by Knapp Brothers and the other by the
Cotton Exchange saloon, collapsed. In the Cotton Exchange saloon
there were about fifteen persons. Most of them escaped.
“The cotton mills, the bagging factory, the gas works, the electric
light works and nearly all the industrial establishments of the city are
either wrecked or crippled. The flood left a slime about one inch deep
over the whole city, and unless fast progress is made in burying
corpses and carcasses of animals there is danger of pestilence. Some
of the stories of the escapes are miraculous. William Nisbett, a cotton
man, was buried in the ruins of the Cotton Exchange saloon, and
when dug out in the morning had no further injury than a few
bruised fingers.
“Dr. S. O. Young, Secretary of the Cotton Exchange, was
knocked senseless when his house collapsed, but was revived by the
water, and was carried ten blocks by the hurricane. A woman who
had just given birth to a child was carried from her home to a house a
block distant, the men who were carrying her having to hold her high
above heads, as the water was five feet deep when she was moved.
“Many stories were current of houses falling and inmates
escaping. Clarence N. Ousley, editor of the Evening Tribune, had his
family and the families of two neighbors in his house when the lower
half crumbled and the upper part slipped down into the water. No
one in the house was hurt.
“The Mistrot House, in the West End, was turned into a hospital.
All of the regular hospitals of the city were unavailable. Of the new
Southern Pacific Works little remains but the piling. Half a million
feet of lumber was carried away, and Engineer Boschke says, as far as
the company is concerned, it might as well start over again.
EIGHT OCEAN STEAMERS STRANDED.
“Eight ocean steamers were torn from their moorings and
stranded in the bay. The Kendall Castle was carried over the flats at
Thirty-third street wharf to Texas City, and lies in the wreckage of
the Inman pier. The Norwegian steamer Gyller is stranded between
Texas City and Virginia Point. An ocean liner was swirled around
through the west bay, crashed through the bay bridges, and is now
lying in a few feet of water near the wreckage of the railroad bridges.
“The steamship Taunton was carried across Pelican Point and is
stranded about ten miles up the east bay. The Mallory steamer
Alamo was torn from her wharf and dashed upon Pelican flats, and
against the bow of the British steamer Red Cross, which had
previously been hurled there. The stern of the Alamo is stove in and
the bow of the Red Cross is crushed. Down the channel to the jetties
two other ocean steamships lie grounded. Some schooners, barges
and smaller craft are strewn bottom side up along the slips of the
piers. The tug Louise, of the Houston Direct Navigation Company, is
also a wreck.
“It will take a week to tabulate the dead and the missing and to
get anything near an approximate idea of the monetary loss. It is safe
to assume that one-half the property of the city is wiped out, and that
one-half of the residents have to face absolute poverty.
“At Texas City three of the residents were drowned. One man
stepped into a well by a mischance and his corpse was found there.
Two other men ventured along the bay front during the height of the
storm and were killed. There are but few buildings at Texas City that
do not tell the story of the storm. The hotel is a complete ruin. The
office of the Texas City Company was almost entirely destroyed.
Nothing remains of the piers except the piling.
“The wreckage from Galveston litters the shore for miles and is a
hundred yards wide. For ten miles inland from the shore it is a
common sight to see small craft, such as steam launches, schooners
and oyster sloops. The life boat of the life-saving station was carried
half a mile inland, while a vessel that was anchored in Moses Bayou
lies high and dry five miles up from La Marque.
MULTITUDES SWEPT OUT TO SEA.
“From Virginia Point north and south along the bay front, at
such places as Texas City, Dickinson, Hitchcock, Seabrook, Alvin and
a dozen small intermediate points, the number of dead bodies
gathered up by rescue trains and sailing craft had reached at noon
more than 700. This is only a small scope of the country devastated,
and it is feared the death list from the storm will ultimately show not
less than 5000 victims. Hundreds have been swept out to sea who
will never be accounted for. Two mass meetings were held at Dallas,
and many thousands of dollars were subscribed for the relief of the
Texas Gulf coast storm sufferers.”
The towns of Sabine Pass and Port Arthur, news from which was
anxiously awaited, passed through the terrific storm virtually
unscathed. At Port Arthur the water spread over the town, but it did
not reach a depth sufficient to destroy buildings. The town pleasure
pier was washed away completely, as was also the pier in front of the
Gales and Elwood Homes. The dredge Florida, property of the New
York Dredging Company, which cut the Port Arthur Channel, sunk at
the mouth of Taylor Bayou. No other property of consequence was
injured.
At Sabine Pass the water reached a depth of about three feet, but
nothing except small buildings near the water-front were washed
away. Several mud-scows and sloops were washed ashore. The
Southern Pacific wharves and warehouses were not damaged in the
least. The railroad between Beaumont and Sabine Pass was under
water for a distance of twelve miles, but not more than four miles
were washed out. The life-saving station of Sabine Pass was washed
from its blocks, but the light tower was not damaged. There was
considerable damage at Sabine Pass by water rising into the streets.
ARMY TENTS AND RATIONS FOR THE
SUFFERERS.
The officers of the National Government took steps at once to
render all possible aid and assistance to the flood-sufferers of Texas.
The President sent telegrams of sympathy to the Governor of the
State and the Mayor of Galveston, and promised to render all
possible relief. Adjutant-General Corbin also telegraphed
instructions to General McKibbin, commanding the Department of
Texas at San Antonio, to proceed to Galveston and investigate the
character and extent of the damage caused by the hurricane, and to
report to the Secretary of War what steps were necessary to alleviate
the sufferings of the people and improve the situation.
Battery O, First Artillery, which garrisoned Fort San Jacinto,
was commanded by Captain William C. Rafferty. First Lieutenant
Lassiter was on detail duty at West Point, but the Second Lieutenant,
J. C. Nichols, was with his company during the storm. Acting
Secretary of the Treasury Spalding ordered two revenue cutters, one
at Norfolk and one at Wilmington, N.C., to proceed at once to
Mobile, Ala., and there await orders. They were needed in supplying
food and tents to the storm-sufferers.
Governor Sayers, of Texas, applied to the War Department for
10,000 tents and 50,000 rations for immediate use for the sufferers.
Acting Secretary Meiklejohn issued an order granting the request.
The tents were sent from San Antonio and Jefferson Barracks,
Missouri. A large portion of the rations was procured at San Antonio.
AN APPEAL FROM HOUSTON.
The following telegrams passed between the White House and
Texas:

“Houston, Texas, September 10.—William McKinley, President


of the United States, Washington, D. C.: I have been deputized by the
Mayor and Citizens’ Committee of Galveston to inform you that the
city of Galveston is in ruins, and certainly many hundreds, if not a
thousand, are dead. The tragedy is one of the most frightful in recent
times. Help must be given by the State and Nation or the suffering
will be appalling. Food, clothing and money will be needed at once.
The whole south side of the city for three blocks in from the Gulf is
swept clear of every building, the whole wharf front is a wreck and
but few houses in the city are really habitable. The water supply is cut
off and the food stock damaged by salt water. All bridges are washed
away, and stranded steamers litter the bay. When I left this morning
the search for bodies had begun. Corpses were everywhere. Tempest
blew eighty-four miles an hour, and then carried Government
instruments away. At same time waters of Gulf were over whole city,
having risen twelve feet. Water has now subsided, and the survivors
are left helpless among the wreckage, cut off from the world except
by boat.
“Richard Spillane.”

“Washington, September 10.—Hon. J. D. Sayers, Governor of


Texas, Austin, Texas: The reports of the great calamity which has
befallen Galveston and other points on the coast of Texas excite my
profound sympathy for the sufferers, as they will stir the hearts of the
whole country. Whatever help it is possible to give shall be gladly
extended. Have directed the Secretary of War to supply rations and
tents upon your request.
“William McKinley.”

A copy of this telegram was sent to the Mayor of Galveston as


well as to Governor Sayers.

“Austin, Texas, September 10.—The President, Washington:


Very many thanks for your telegram. Your action will be greatly
appreciated and gratefully remembered by the people of Texas. I
have this day requested the Secretary of War to forward rations and
tents to Galveston.
“Joseph D. Sayers,
“Governor of Texas.”
CLARA BARTON READY FOR RELIEF
WORK.
Miss Clara Barton issued the following appeal in behalf of the
Texas sufferers:

“The American National Red Cross, at Washington, D. C., is


appealed to on all sides for help and for the privilege to help in the
terrible disaster which has befallen Southern and Central Texas. It
remembers the floods of the Ohio and Mississippi, of Johnstown,
and of Port Royal, with their thousands of dead and months of
suffering and needed relief, and turns confidently to the people of the
United States, whose sympathy has never failed to help provide the
relief that is asked of it now. Nineteen years of experience on nearly
as many fields renders the obligations of the Red Cross all the
greater. The people have long learned its work, and it must again
open its accustomed avenues for their charities. It does not beseech
them to give, for their sympathies are as deep and their humanity as
great as its own, but it pledges to them faithful old-time Red Cross
relief work among the stricken victims of these terrible fields of
suffering and death.
“He gives twice who gives quickly.
“Contributions may be wired or sent by mail to our Treasurer,
William J. Flather, Assistant Cashier Riggs National Bank,
Washington, D. C.; also to the local Red Cross committees of the Red
Cross India Famine Fund, at 156 Fifth avenue, New York City, and
the Louisiana Red Cross of New Orleans, both of whom will report all
donations for immediate acknowledgment by us.
“Clara Barton,
“President National American Red Cross.”
Miss Barton telegraphed Governor Sayers, at Austin, Tex., as
follows:
“Do you need the Red Cross in Texas? We are ready.”
THE DESTRUCTION INLAND.
Later details show that from Red River on the north to the Gulf
on the south and throughout the central part of the State, Texas was
storm-swept by a hurricane which laid waste property, caused large
loss of life, and effectually blocked all telegraphic and telephonic
communication south, while the operation of trains was seriously
handicapped.
Starting with the hurricane which visited Galveston and the Gulf
coast Saturday noon, and which was still prevailing there to such an
extent that no communication could be had with the island to
ascertain what the loss to life and property was, the storm made
rapid inroads into the centre of the State, stopping long enough at
Houston to damage over half of the buildings of that city.
Advancing inland, the storm swept into Hempstead, fifty miles
above Houston, thence to Chappell Hill, twenty miles further; thence
to Brenham, thirty miles further, wrecking all three towns. Several
persons were killed.
The Brazos bottom suffered a large share of damage at the hands
of the hurricane, and was swept for fully 100 miles of its length,
everything being turned topsy-turvy by the high winds, and much
destruction resulting to crops as well as farmhouse property. The
winds were accompanied by a heavy rainfall, which served to add to
the horror of midnight. The telegraph and telephone companies have
large forces of men trying to rig up wires to Galveston. The storm
seems to have swept all the tableland clear of everything on it, razing
houses to the ground and tearing up trees by the roots. It also swept
into the mountain gorges and there inflicted the worst damage, and
considerable loss of life was reported from that section. From
Southwest Texas and points along the Gulf to the city of Galveston
the reports were alarming. A number of parties summering at
various points along the coast were not heard from. The cotton was
nearly ruined, as the storm swept the cotton-belt.
CHAPTER III.
Incidents of the Awful Hurricane—
Unparalleled Atrocities by Lawless Hordes—
Earnest Appeals for Help.

O n September 11th, the Mayor of Galveston forwarded the


following address to the people of the United States:

“It is my opinion, based on personal information, that 5000


people have lost their lives here. Approximately one-third of the
residence portion of the city has been swept away.
“There are several thousand people who are homeless and
destitute. How many, there is no way of finding out. Arrangements
are now being made to have the women and children sent to
Houston and other places, but the means of transportation are
limited. Thousands are still to be cared for here. We appeal to you for
immediate aid.
“WALTER C. JONES.”

On the same date the following statement of conditions at


Galveston and appeal for aid was issued by the local relief
committee:
“A conservative estimate of the loss of life is that it will reach at
least 5,000, and at least that number of families are shelterless and
wholly destitute. The entire remainder of the population is suffering
in a greater or less degree. Not a single church, school or charitable
institution, of which Galveston had so many, is left intact. Not a
building escaped damage, and half the whole number were entirely
obliterated. There is immediate need for food, clothing and
household goods of all kinds. If nearby cities will open asylums for
women and children, the situation will be greatly relieved. Coast
cities should send us water, as well as provisions, including kerosene,
oil, gasoline and candles.
“W. C. Jones, mayor; M. Lasker, president Island City Saving
Bank; J. D. Skinner, president Cotton Exchange; C. H. McMaster, for
Chamber of Commerce; R. G. Lowe, manager Galveston News;
Clarence Owsley, manager Galveston Tribune.”
The white cotton screw men’s organization held a meeting and
tendered their services, that of 500 able bodied men, to the public
committee to clear the streets of debris. Big forces went to work, and
the situation was much improved so far as the passage of vessels was
concerned. The city was patrolled by regular soldiers and citizen
soldiery. No one was allowed on the streets without a pass. Several
negroes were shot for not halting when ordered.
The steamer Lawrence arrived here early on the morning of the
11th, from Houston, with water and provisions. A committee of one
hundred citizens were aboard, among them being doctors and cooks.
W. G. Van Vleck, General Manager of the Southern Pacific Railroad,
arrived at the same time. He thought it would be possible to establish
mail service from Houston to Texas City by night, with transfer boats
to Galveston.
BODIES BEING BURIED IN TRENCHES.
It was found to be impossible to send bodies to sea for burial.
The water receded so far, however, that it was possible to dig
trenches, and bodies were being buried where found. Debris covering
bodies was being burned where it could be done safely.
Work on the water works was rushed, and it was hoped to be
able to turn a supply on in the afternoon.
Outside of Galveston smaller towns were beginning to send in
reports as telegraphic communication improved, and many additions
to the list of the dead and property losses were received. Richmond
and Hitchcock each reported sixteen lives lost. Alto Loma, Arcadia,
Velasco, Seabrooke, Belleville, Areola and many other towns had
from one to eight dead. In most of these places many houses were
totally destroyed and thousands of head of live stock killed.
The railroads alone suffered millions of dollars in actual
damage, to say nothing of the loss from stoppage of business. The
International and Great Northern and Santa Fe had miles of track
washed out, and the bridges connecting Galveston with the mainland
must be entirely rebuilt.
The following is the description of an eye-witness on September
11: “Galveston is almost wiped off the earth. Fifteen thousand
persons are homeless. The loss of life will reach into the thousands.
Bodies are piled everywhere.
“When daylight broke over the expanse of floating bodies,
rubbish heaps and ruins were all that remained of the prosperous
city. A few leading citizens assembled in several feet of water at a
street corner and called a meeting at the Tremont Hall, to which they
adjourned. A committee of Public Safety of fifteen leading citizens
was formed, and Colonel J. H. Hawley, one of the best known men in
Texas, was made chairman. He, with Mayor Walter C. Jones and
Chief of Police Edward Ketchum, formed a triumvirate, with absolute
power, and declared the city under martial law.
MILITARY FORCES AND SPECIAL POLICE.
“They issued a commission to Major L. R. D. Fayling, which
made him commander-in-chief of all military forces and special
deputies of police, and only subject to the orders of the Mayor and
the Chief of Police. Major Fayling was authorized to requisition any
men or property he may require for his force, and his receipt will be
honored by the city of Galveston and any such property paid for by
the city.
“As soon as Major Fayling received his authority he collected a
handful of half-naked, barefooted soldiers, clothed them, supplied
them with food and put them under command of Captain Edward
Rogers. Around this nucleus of a force he has built up to meet the
necessities of the situation his present force of three full companies
of volunteer soldiers and a troop of cavalry.
“A horde of negroes and whites—even white women—were in
the ruins of the city. They were robbing the dead and dying, killing
those who resisted, cutting off fingers to obtain rings and ears to
obtain earrings. Drunken men reeled about the streets intimidating
citizens.
“Chief of Police Ketchum ordered the sale of liquor stopped, and
began to swear in hundreds of special policemen to rescue the
wounded, feed the living and convey the dead to a hundred different
morgues. He worked for thirty-six hours without going home to
inquire about his family’s fate, which was in doubt. When told he
should do so he replied, characteristically, ‘God will be good to me
and mine, for I am going to be good to others.’
THE STENCH UNBEARABLE.
“The stench from the dead by Monday morning was unbearable.
The triumvirate ruling the city pressed citizens into service to take
the dead out in barges and bury them in the Gulf. The soldiers
impressed into service, at the point of the bayonet, every wagon that
came along and every negro to assist in throwing the dead into the
sea. It was impossible to give other burial.
“From the stench which pervades the city it is apparent that
hundreds of bodies yet lie under the ruins. The sun is hotter than in
July. The regular soldiers, who had been working for two days with
bloody feet, were utterly exhausted by Monday evening, and were
assembled by Captain Rafferty and put in a hastily extemporized
hospital, which was formerly a church. Their places were filled by
Major Fayling with new recruits, whom he drafted on the streets and
supplied with arms and equipment from the local armory.
“Every part of the city was patrolled by 6 o’clock in the evening.
Among many other incidents of last night was the besieging of the
squad guarding St. Mary’s Hospital. They were surrounded by a
horde of armed negro thieves. Several hundred shots were
exchanged. Sergeant Camp killed four negroes with his rifle, and
about ten or twelve were killed by the squad. The soldiers have since
been picketing the city, doing fourteen hours’ duty without rest.
Every hour during the night a fresh negro shooting was reported at
headquarters.
“The tug ‘Juno’ and the propeller ‘Lawrence’ brought 2000
gallons of water here from Houston but the supply is not enough to
go around, and half the population is without any water. Breakfast at
the $4 per day hotel Tremont was served to a fortunate few to-day,
and consisted of a small piece of bacon and a single cup of coffee.
The hotel was untenable yesterday, and guests were refused. It is
jammed to-day with local citizens who have been made homeless.”
G. W. Ware, teacher of penmanship in a Dallas educational
institution, was in Galveston during the hurricane. He reached Dallas
on Tuesday, the 11th and made the following statement:
WORK OF HEARTLESS CRIMINALS.
“It was a godsend, the placing of the city under martial law. The
criminal element began looting the dead, and the cold blooded
commercial element began looting the living. The criminals were
stealing anything they could with safety lay hands on, and the
mercenary commercial pirates began a harvest of extortion. The
price of bacon was pushed up to 50 cents a pound, bread 60 cents a
loaf, and owners of small schooners and other sailing craft formed a
trust, and charged $8 a passenger for transportation across the bay
from the island to the mainland.
“Mayor Jones and other men of conscience were shocked at
these proceedings, and the Mayor decided that the only protection
for the citizens would be to declare martial law, confiscate all
foodstuffs and other necessities for the common good, and thus stop
the lootings and holdups.
“The price of bread was reduced to 10 cents a loaf, bacon was
placed at 15 cents a pound, and the price of a voyage across the bay
was set at $1.50 a passenger. A book account is being kept of all sales
of foodstuffs, and other transactions and settlements will be made at
the scheduled rates.”
Mr. Quinlan, General Manager of the Houston and Texas
Central Railroad, said:
“It is in such cases as this Galveston disaster that the barbarity
in some men is seen. I have seen enough in the last two days to
convince me that a large element of civilized mankind are veneered
savages. My policy would be to take nobody into Galveston except
such persons as are absolutely needed to administer to the
distressed. Thousands of residents of Galveston ought to be brought
out of there as fast as boats can bring them to the mainland, and
establish them in charity or detention camps on high ground, where
they can get pure air and water and receive attention which cannot
be given to them on the island.
“I hope Governor Sayres will find authority to enforce some such
policy. This relief work is going to be an all-winter task. Persons who
have lost homes and places of business must be taken charge of until
they can properly take care of themselves.”
THE FINANCIAL OUTCOME.
The effect that Galveston’s disaster may have upon the financial
obligations of that city was an interesting topic among local
financiers. Whether the bonds will be paid when due or whether
interest default will result when coupons are presented is a mooted
question in certain circles. J. B. Adone, banker, of Dallas, and former
member of the old banking firm of Flippin, Adone & Lobit, of
Galveston, said concerning these points:
“Galveston’s bond and interest obligations will be promptly met,
I feel sure. If left to their own resources in the face of the present
calamity, the people of Galveston and their public officials would be
probably temporarily embarrassed, but there will be no repudiation
or defalcation. The people of Texas will respond to the needs of
Galveston in her present terrible affliction, and out of the moneys
contributed the city’s financial credit will be protected if this course
should be found necessary.”
Pursuant to the proclamation of Mayor Brashear, issued Sunday
night, a citizens’ meeting was held in the city council chamber at
Houston and an organization effected for the relief of the victims of
the storm. The following telegram was received by the Mayor from
Governor Sayres:

“Austin, Texas, Sept. 10.—I have taken the liberty of directing


that all supplies of food and clothing for Galveston be shipped to you.
Will you undertake to forward them when received to Galveston for
distribution? Answer quick.
“JOSEPH D. SAYRES, Governor.”

Mayor Brashear immediately replied that all supplies would be


distributed where mostly needed. A telegram from Areola was
received, and there were twenty-five persons there, mostly women
and children, in urgent need of relief.
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!

ebookfinal.com

You might also like