100% found this document useful (4 votes)
119 views

Ebooks File (Ebook PDF) Starting Out With C++: From Control Structures Through Objects 8th Edition All Chapters

Out

Uploaded by

evinnakurir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (4 votes)
119 views

Ebooks File (Ebook PDF) Starting Out With C++: From Control Structures Through Objects 8th Edition All Chapters

Out

Uploaded by

evinnakurir
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Download the full version of the ebook now at ebooksecure.

com

(eBook PDF) Starting Out with C++: From


Control Structures through Objects 8th
Edition

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

Explore and download more ebook at https://ebooksecure.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

(eBook PDF) Starting Out with C++: From Control Structures


through Objects, Brief Version 8th Edition

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

ebooksecure.com

(eBook PDF) Starting Out with Java: From Control


Structures through Objects, 7th Edition

https://ebooksecure.com/product/ebook-pdf-starting-out-with-java-from-
control-structures-through-objects-7th-edition/

ebooksecure.com

(eBook PDF) Starting Out with C++ from Control Structures


to Objects 9th Edition

https://ebooksecure.com/product/ebook-pdf-starting-out-with-c-from-
control-structures-to-objects-9th-edition/

ebooksecure.com

(eBook PDF) Commercial Applications of Company Law 2019


20th Edition

https://ebooksecure.com/product/ebook-pdf-commercial-applications-of-
company-law-2019-20th-edition/

ebooksecure.com
Junqueira’s Basic Histology Text and Atlas 15th Edition
Anthony L. Mescher - eBook PDF

https://ebooksecure.com/download/junqueiras-basic-histology-text-and-
atlas-ebook-pdf-2/

ebooksecure.com

Handbook of Dialysis Therapy 6th Edition Allen R.


Nissenson - eBook PDF

https://ebooksecure.com/download/handbook-of-dialysis-therapy-ebook-
pdf/

ebooksecure.com

McGraw-Hill's National Electrical Code (NEC) 2017


Handbook, 29th Edition (Mcgraw Hill's National Electrical
Code Handbook) Hartwell - eBook PDF
https://ebooksecure.com/download/mcgraw-hills-national-electrical-
code-nec-2017-handbook-29th-edition-mcgraw-hills-national-electrical-
code-handbook-ebook-pdf/
ebooksecure.com

Green Synthetic Approaches for Biologically Relevant


Heterocycles Volume 2: Green Catalytic Systems and
Solvents 2nd Edition Goutam Brahmachari - eBook PDF
https://ebooksecure.com/download/green-synthetic-approaches-for-
biologically-relevant-heterocycles-volume-2-green-catalytic-systems-
and-solvents-ebook-pdf/
ebooksecure.com

Pharmacology for Medical Graduates, 4th Updated Edition


Shanbhag - eBook PDF

https://ebooksecure.com/download/pharmacology-for-medical-
graduates-4th-updated-edition-ebook-pdf-2/

ebooksecure.com
Electrocardiography For Healthcare Professionals Ise
(paperback) 5th Edition - eBook PDF

https://ebooksecure.com/download/electrocardiography-for-healthcare-
professionals-ise-paperback-ebook-pdf/

ebooksecure.com
Contents

Preface xv

CHAPTER 1 Introduction to Computers and Programming 1


1.1 Why Program? 1
1.2 Computer Systems: Hardware and Software 2
1.3 Programs and Programming Languages 8
1.4 What Is a Program Made of? 14
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 48
2.8 The C++ string Class 52
2.9 Floating-Point Data Types 54
2.10 The bool Data Type 57
2.11 Determining the Size of a Data Type 58
2.12 Variable Assignments and Initialization 59
2.13 Scope 61
2.14 Arithmetic Operators 61
2.15 Comments 69
2.16 Named Constants 71
2.17 Programming Style 73

vii
viii Contents

CHAPTER 3 Expressions and Interactivity 83


3.1 The cin Object 83
3.2 Mathematical Expressions 89
3.3 When You Mix Apples and Oranges: Type Conversion 98
3.4 Overflow and Underflow 100
3.5 Type Casting 101
3.6 Multiple Assignment and Combined Assignment 104
3.7 Formatting Output 108
3.8 Working with Characters and string Objects 118
3.9 More Mathematical Library Functions 124
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 Variable 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 284

CHAPTER 6 Functions 299


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

6.5 Passing Data by Value 316


6.6 Focus on Software Engineering: Using Functions in a
Menu-Driven Program 318
6.7 The return Statement 322
6.8 Returning a Value from a Function 324
6.9 Returning a Boolean Value 332
6.10 Local and Global Variables 334
6.11 Static Local Variables 342
6.12 Default Arguments 345
6.13 Using Reference Variables as Parameters 348
6.14 Overloading Functions 354
6.15 The exit() Function 358
6.16 Stubs and Drivers 361

CHAPTER 7 Arrays 375


7.1 Arrays Hold Multiple Values 375
7.2 Accessing Array Elements 377
7.3 No Bounds Checking in C++ 384
7.4 Array Initialization 387
7.5 The Range-Based for Loop 392
7.6 Processing Array Contents 396
7.7 Focus on Software Engineering: Using Parallel Arrays 404
7.8 Arrays as Function Arguments 407
7.9 Two-Dimensional Arrays 418
7.10 Arrays with Three or More Dimensions 425
7.11 Focus on Problem Solving and Program Design: A Case Study 427
7.12 If You Plan to Continue in Computer Science: Introduction to the
STL vector 429

CHAPTER 8 Searching and Sorting Arrays 457


8.1 Focus on Software Engineering: Introduction to Search Algorithms 457
8.2 Focus on Problem Solving and Program Design: A Case Study 463
8.3 Focus on Software Engineering: Introduction to Sorting Algorithms 470
8.4 Focus on Problem Solving and Program Design: A Case Study 477
8.5 If You Plan to Continue in Computer Science: Sorting and
Searching vectors 485

CHAPTER 9 Pointers 495


9.1 Getting the Address of a Variable 495
9.2 Pointer Variables 497
9.3 The Relationship Between Arrays and Pointers 504
9.4 Pointer Arithmetic 508
9.5 Initializing Pointers 510
9.6 Comparing Pointers 511
9.7 Pointers as Function Parameters 513
9.8 Focus on Software Engineering: Dynamic Memory Allocation 522
9.9 Focus on Software Engineering: Returning Pointers from Functions 526
9.10 Using Smart Pointers to Avoid Memory Leaks 533
9.11 Focus on Problem Solving and Program Design: A Case Study 536
x Contents

CHAPTER 10 Characters, C-Strings, and More About the string Class 547
10.1 Character Testing 547
10.2 Character Case Conversion 551
10.3 C-Strings 554
10.4 Library Functions for Working with C-Strings 558
10.5 C-String/Numeric Conversion Functions 569
10.6 Focus on Software Engineering: Writing Your Own
C-String-Handling Functions 575
10.7 More About the C++ string Class 581
10.8 Focus on Problem Solving and Program Design: A Case Study 590

CHAPTER 11 Structured Data 599


11.1 Abstract Data Types 599
11.2 Focus on Software Engineering: Combining Data into Structures 601
11.3 Accessing Structure Members 604
11.4 Initializing a Structure 608
11.5 Arrays of Structures 611
11.6 Focus on Software Engineering: Nested Structures 613
11.7 Structures as Function Arguments 617
11.8 Returning a Structure from a Function 620
11.9 Pointers to Structures 623
11.10 Focus on Software Engineering: When to Use ., When to Use ->,
and When to Use * 626
11.11 Unions 628
11.12 Enumerated Data Types 632

CHAPTER 12 Advanced File Operations 657


12.1 File Operations 657
12.2 File Output Formatting 663
12.3 Passing File Stream Objects to Functions 665
12.4 More Detailed Error Testing 667
12.5 Member Functions for Reading and Writing Files 670
12.6 Focus on Software Engineering: Working with Multiple Files 678
12.7 Binary Files 680
12.8 Creating Records with Structures 685
12.9 Random-Access Files 689
12.10 Opening a File for Both Input and Output 697

CHAPTER 13 Introduction to Classes 711


13.1 Procedural and Object-Oriented Programming 711
13.2 Introduction to Classes 718
13.3 Defining an Instance of a Class 723
13.4 Why Have Private Members? 736
13.5 Focus on Software Engineering: Separating Class Specification
from Implementation 737
13.6 Inline Member Functions 743
13.7 Constructors 746
13.8 Passing Arguments to Constructors 750
Contents xi

13.9 Destructors 758


13.10 Overloading Constructors 762
13.11 Private Member Functions 765
13.12 Arrays of Objects 767
13.13 Focus on Problem Solving and Program Design: An OOP Case Study 771
13.14 Focus on Object-Oriented Programming: Simulating Dice with Objects 778
13.15 Focus on Object-Oriented Programming: Creating an Abstract Array
Data Type 782
13.16 Focus on Object-Oriented Design: The Unified Modeling Language (UML) 785
13.17 Focus on Object-Oriented Design: Finding the Classes and Their
Responsibilities 788

CHAPTER 14 More About Classes 811


14.1 Instance and Static Members 811
14.2 Friends of Classes 819
14.3 Memberwise Assignment 824
14.4 Copy Constructors 825
14.5 Operator Overloading 831
14.6 Object Conversion 858
14.7 Aggregation 860
14.8 Focus on Object-Oriented Design: Class Collaborations 865
14.9 Focus on Object-Oriented Programming: Simulating the Game
of Cho-Han 869

CHAPTER 15 Inheritance, Polymorphism, and Virtual Functions 891


15.1 What Is Inheritance? 891
15.2 Protected Members and Class Access 900
15.3 Constructors and Destructors in Base and Derived Classes 906
15.4 Redefining Base Class Functions 918
15.5 Class Hierarchies 923
15.6 Polymorphism and Virtual Member Functions 929
15.7 Abstract Base Classes and Pure Virtual Functions 945
15.8 Multiple Inheritance 952

CHAPTER 16 Exceptions, Templates, and the Standard Template


Library (STL) 971
16.1 Exceptions 971
16.2 Function Templates 990
16.3 Focus on Software Engineering: Where to Start When Defining Templates 996
16.4 Class Templates 996
16.5 Introduction to the Standard Template Library (STL) 1005

CHAPTER 17 Linked Lists 1025


17.1 Introduction to the Linked List ADT 1025
17.2 Linked List Operations 1027
17.3 A Linked List Template 1043
17.4 Variations of the Linked List 1055
17.5 The STL list Container 1056
xii Contents

CHAPTER 18 Stacks and Queues 1063


18.1 Introduction to the Stack ADT 1063
18.2 Dynamic Stacks 1080
18.3 The STL stack Container 1091
18.4 Introduction to the Queue ADT 1093
18.5 Dynamic Queues 1105
18.6 The STL deque and queue Containers 1112

CHAPTER 19 Recursion 1121


19.1 Introduction to Recursion 1121
19.2 Solving Problems with Recursion 1125
19.3 Focus on Problem Solving and Program Design: The Recursive
gcd Function 1133
19.4 Focus on Problem Solving and Program Design: Solving Recursively
Defined Problems 1134
19.5 Focus on Problem Solving and Program Design: Recursive Linked List
Operations 1135
19.6 Focus on Problem Solving and Program Design: A Recursive Binary
Search Function 1139
19.7 The Towers of Hanoi 1141
19.8 Focus on Problem Solving and Program Design: The QuickSort Algorithm 1144
19.9 Exhaustive Algorithms 1148
19.10 Focus on Software Engineering: Recursion vs. Iteration 1151

CHAPTER 20 Binary Trees 1155


20.1 Definition and Applications of Binary Trees 1155
20.2 Binary Search Tree Operations 1158
20.3 Template Considerations for Binary Search Trees 1175

Appendix A: Getting Started with Alice 1185


Appendix B: The ASCII Character Set 1211
Appendix C: Operator Precedence and Associativity 1213
Quick References 1215
Index 1217
Credit 1237

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: Passing Command Line Arguments
Appendix H: Header File and Library Function Reference
Appendix I: Binary Numbers and Bitwise Operations
Appendix J: Multi-Source File Programs
Appendix K: Stream Member Functions for Formatting
Appendix L: Answers to Checkpoints
Appendix M: Solutions to Odd-Numbered Review Questions
LOCATION OF VIDEONOTES IN THE TEXT

Chapter 1 Introduction to Flowcharting, p. 20


Designing a Program with Pseudocode, p. 20
Designing the Account Balance Program, p. 25
Predicting the Result of Problem 33, p. 26
Chapter 2 Using cout, p. 31
Variabe Definitions, p. 37
Assignment Statements and Simple Math Expressions, p. 62
Solving the Restaurant Bill Problem, p. 80
Chapter 3 Reading Input with cin, p. 83
Formatting Numbers with setprecision, p. 111
Solving the Stadium Seating Problem, p. 142
Chapter 4 The if Statement, p. 154
The if/else statement, p. 166
The if/else if Statement, p. 176
Solving the Time Calculator Problem, p. 221
Chapter 5 The while Loop, p. 232
The for Loop, p. 247
Reading Data from a File, p. 274
Solving the Calories Burned Problem, p. 293
Chapter 6 Functions and Arguments, p. 311
Value-Returnlng Functions, p. 324
Solving the Markup Problem, p. 366
Chapter 7 Accessing Array Elements With a Loop, p. 380
Passing an Array to a Function, p. 407
Solving the Chips and Salsa Problem, p. 448
Chapter 8 The Binary Search, p. 460
The Selection Sort, p. 474
Solving the Charge Account Validation Modification Problem, p. 492
Chapter 9 Dynamically Allocating an Array, p. 523
Solving the Pointer Rewrite Problem, p. 545
Chapter 10 Writing a C-String-Handling Function, p. 575
More About the string Class, p. 581
Solving the Backward String Problem, p. 594
(continued on the next page)
LOCATION OF VIDEONOTES IN THE TEXT (continued)

Chapter 11 Creating a Structure, p. 601


Passing a Structure to a Function, p. 617
Solving the Weather Statistics Problem, p. 652
Chapter 12 Passing File Stream Objects to Functions, p. 665
Working with Multiple Files, p. 678
Solving the File Encryption Filter Problem, p. 708
Chapter 13 Writing a Class, p. 718
Defining an Instance of a Class, p. 723
Solving the Employee Class Problem, p. 802
Chapter 14 Operator Overloading, p. 831
Class Aggregation, p. 860
Solving the NumDays Problem, p. 885
Chapter 15 Redefining a Base Class Function in a Derived Class, p. 918
Polymorphism, p. 929
Solving the Employee and Production-Worker Classes Problem, p. 963
Chapter 16 Throwing an Exception, p. 972
Handling an Exception, p. 972
Writing a Function Template, p. 990
Storing Objects in a vector, p. 1010
Solving the Exception Project Problem, p. 1024
Chapter 17 Appending a Node to a Linked List, p. 1028
Inserting a Node in a Linked List, p. 1035
Deleting a Node from a Linked List, p. 1039
Solving the Member Insertion by Position Problem, p. 1061
Chapter 18 Storing Objects in an STL stack, p. 1091
Storing Objects in an STL queue, p. 1114
Solving the File Compare Problem, p. 1119
Chapter 19 Reducing a Problem with Recursion, p. 1126
Solving the Recursive Multiplication Problem, p. 1153
Chapter 20 Inserting a Node in a Binary Tree, p. 1160
Deleting a Node from a Binary Tree, p. 1166
Solving the Node Counter Problem, p. 1182
Preface

Welcome to Starting Out with C++: From Control Structures through Objects, 8th edition.
This book is intended for use in a two-semester C++ programming sequence, or an acceler-
ated one-semester course. Students new to programming, as well as those with prior course
work in other languages, will find this text beneficial. 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 intro-
ductory programming course. This text is rich in example programs that are concise, practi-
cal, 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 Eighth Edition


C++11 is the latest standard version of the C++ language. In previous years, while the stan-
dard was being developed, it was known as C++0x. In August 2011, it was approved by
the International Standards Organization (ISO), and the name of the standard was officially
changed to C++11. Most of the popular compilers now support the C++11 standard.
The new C++11 standard was the primary motivation behind this edition. Although this
edition introduces many of the new language features, a C++11 compiler is not strictly
required to use the book. As you progress through the book, you will see C++11 icons in the
margins, next to the new features that are introduced. Programs appearing in sections that
are not marked with this icon will still compile using an older compiler.
Here is a summary of the new C++11 topics that are introduced in this edition:
● The auto key word is introduced as a way to simplify complex variable definitions.
The auto key word causes the compiler to infer a variable’s data type from its initial-
ization value.
● The long long int and unsigned long long int data types, and the LL literal
suffix are introduced.
● Chapter 5 shows how to pass a string object directly to a file stream object’s open
member function, without the need to call the c_str() member function. (A discus-
sion of the c_str()function still exists for anyone using a legacy compiler.)

xv
Visit https://testbankfan.com
now to explore a rich
collection of testbank or
solution manual and enjoy
exciting offers!
xvi Preface

● The range-based for loop is introduced in Chapter 7. This new looping mechanism
automatically iterates over each element of an array, vector, or other collection,
without the need of a counter variable or a subscript.
● Chapter 7 shows how a vector can be initialized with an initialization list.
● The nullptr key word is introduced as the standard way of representing a null
pointer.
● Smart pointers are introduced in Chapter 9, with an example of dynamic memory
allocation using unique_ptr.
● Chapter 10 discusses the new, overloaded to_string functions for converting numeric
values to string objects.
● The string class’s new back() and front() member functions are included in
Chapter 10’s overview of the string class.
● Strongly typed enums are discussed in Chapter 11.
● Chapter 13 shows how to use the smart pointer unique_ptr to dynamically allocate
an object.
● Chapter 15 discusses the override key word and demonstrates how it can help prevent
subtle overriding errors. The final key word is discussed as a way of preventing a virtual
member function from being overridden.
In addition to the C++11 topics, the following general improvements were made:
● Several new programming problems have been added to the text, and many of the
existing programming problems have been modified to make them unique from previ-
ous editions.
● The discussion of early, historic computers in Chapter 1 is expanded.
● The discussion of literal values in Chapter 2 is improved.
● The introduction of the char data type in Chapter 2 is reorganized to use character
literals in variable assignments before using ASCII values in variable assignments.
● The discussion of random numbers in Chapter 3 is expanded and improved, with the
addition of a new In the Spotlight section.
● A new Focus on Object-Oriented Programming section has been added to Chapter 13,
showing how to write a class that simulates dice.
● A new Focus on Object-Oriented Programming section has been added to Chapter 14,
showing an object-oriented program that simulates the game of Cho-Han. The program
uses objects for the dealer, two players, and a pair of dice.

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 flexibility is provided. The diagram
shown in Figure P-1 suggests possible sequences of instruction.
Preface xvii

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
xviii Preface

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 Chapter
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 Chap-
ter 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 firm 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 field of computer science and covers the fun-
damentals 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, flow charts, and hierarchy charts are also presented.

Chapter 2: Introduction to C++


This chapter gets the student started in C++ by introducing data types, identifiers, vari-
able 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.

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 flow 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.
Preface xix

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 file I/O
is also introduced. The student learns to read and write text files, and use loops to process
the data in a file.

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 find 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 file 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.

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 tech-
nique 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.
xx Preface

Chapter 12: Advanced File Operations


This chapter covers sequential access, random access, text, and binary files. The various
modes for opening files are discussed, as well as the many methods for reading and writing
file 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 fun-
damental concepts of classes. Member variables and functions are discussed. The student
learns about private and public access specifications, and reasons to use each. The topics of
constructors, overloaded constructors, and destructors are also presented. The chapter pres-
ents a section modeling classes with UML and how to find 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, Polymorphism, and Virtual Functions


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 con-
structors and destructors, virtual member functions, base class pointers, static and dynamic
binding, multiple inheritance, and class hierarchies.

Chapter 16: Exceptions, Templates, and the Standard


Template Library (STL)
The student learns to develop enhanced error trapping techniques using exceptions. Discus-
sion 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 Standard
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 defined, 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 finding factorials, finding a greatest common
Exploring the Variety of Random
Documents with Different Content
charge. On the mission-fields there are most important posts that call
in vain for re-enforcements. At home supplies can be had to meet
any emergency within a very short time; but on the mission-field we
often must wait years for the right man. I left Kansas City in the
morning, and my successor, a very worthy and successful man,
arrived in the evening of the same day. But out in Burma I have
pleaded for years for one man to re-enforce the mission. The
Arlington Church, which I was serving, was then and is now a very
enjoyable pastorate—one in which the people, always cherish their
pastor, and better, where they have from the founding of the Church
cordially supported every effort for the salvation of men. The decision
to leave that Church to go half way round the world to a people I had
never seen, was largely due to the fact that we were needed most on
this picket-line of missions, and good men, who for any reason could
not go to the foreign fields, could be found to take up promptly the
work I laid down at home.
The farewells in Kansas City were of the cheerful and happy kind
that send missionaries on their way to their peculiar missions strong
in heart. Arlington Church spoke its own farewell in a reception to
their pastor and his family, while Grand Avenue Church, the
Methodists of Kansas City, followed with a general reception to the
outgoing missionaries. This general gathering was under the
direction of the pastor, Dr. Jesse Bowman Young, and Dr. O. M.
Stewart, the presiding elder. The latter sounded the note of
cheerfulness for the farewell. He said, “Let us have nothing of a
funeral sort about this reception.” We have always thanked him for
the cheerful and hopeful tone which ran all through the meeting. Dr.
Young was of the same spirit, and in his address, which at one
moment bordered on the emotional at the thought of a long parting
from those to whom he had been one of the best of friends,
recovered himself by saying, “If you discover anything suspicious in
my eyes, charge it up to the hayfever.” These good brethren did
more than they knew to set a standard of joyful anticipation on the
part of the Church and the outgoing missionaries in the honorable
service to which they were called, that toned up their courage when
facing the actual separation from home ties. This was of very great
value to us who were leaving a very enjoyable pastorate, a native
land in which we had taken deep root, and most of all, an aged
father and mother.
We left Kansas City on September 3, 1890, and after a little over
two months spent in resting and arranging our affairs, we sailed from
New York for Liverpool on November 12th. The closing hours in New
York were very different from those in Kansas City, and made it
appear very real to us that we were being plucked up from the home
land and transplanted to a foreign country. We had no acquaintances
at all in New York, except one of the Missionary Secretaries, who
had visited us in Kansas City. He and his associates were as kind as
they could be; but then as now, they were men worked beyond their
strength with the burdens of business there is upon them, and at that
particular time were hurried to get off to Boston, to the annual
Missionary Committee meeting, and they had to tell us a hasty
farewell at the Mission Rooms, and leave us to go alone to the ship.
While our sailing was more lonely than that of most missionaries, yet
it is now the custom to make very little out of the departure of men
and women to mission-fields, however distant. The older
missionaries contrast this formal dispatch of recruits with the custom
of forty years ago, when men still in active service, were first sent
out. Then it was the plan to have the new missionaries gathered in
one or more churches, and after speeches and exchange of good-
will all around, to send them forth with the feeling that their outgoing
on this great mission was a matter of moment to the whole Church. It
is presumable that custom may change in this matter from time to
time, and especially as the number and frequency of the departure of
missionaries increase; but it is certain that the departure of
missionaries to our distant fields on this, the highest mission of the
Church, can not be made less of than it has been in recent years.
We sailed on the steamship City of New York, the largest and
swiftest ship then afloat. She loosed her moorings at five o’clock in
the morning of November 12th. It was a gloomy morning with a cold
rain, and though I was on deck to note any objects of interest amidst
the gloom, nothing at all of importance was in view, save the Statue
of Liberty holding its light aloft in the harbor. No departure from the
shores of the home-land could have been less cheering and
romantic. But as the great ship made her way out to sea, there was a
peculiar satisfaction in the feeling that came over us, that we were
actually on our way to Burma. Some time before sailing, it had been
decided that we would go there, making headquarters at Rangoon,
the capital of that province of the Indian Empire.
Our voyage across the Atlantic was uneventful for the most part,
but not uninteresting. On a great ship one has a good opportunity to
study his fellow-passengers. One among our company has since
become an international character, and even then had become
widely known. This personage was none other than Paul Kruger,
President, then and since, of the Transvaal Republic. We then
thought of Majuba Hill and its consequences, but could not foresee
that this son of the African velt would, before ten years had passed,
throw so large a part of the world into turmoil and lead in a great war.
I was impressed with his strong leonine features, and the less heroic
fact that he was one of the first among the passengers to yield to the
power of a rough sea.
Four days out we ran into a great storm that lasted nearly two
days. Up to that time we were making a quick passage, but the wind
and waves soon destroyed all hopes of making a high record. The
storm was worst at midnight, and as we were being rolled until it was
hardly possible to remain in our berths, the ammonia pipes broke
and flooded the lower cabins with gas. Our cabin was located near
that part of the ship where the trouble occurred, but no one was
seriously injured. A similar thing recently happened on the same ship
in a storm on the Atlantic, and again the suffocating gas spread
through the ship with one fatality and a number of prostrations.
Landing at Liverpool, we went to London for ten days, returning
to the former place to take the first ship direct for Rangoon. There
are two general routes from English ports to points in India. By one
you travel across the continent, and usually take ship at some
Mediterranean port, and sail to Bombay. By the other you sail via
Gibraltar, and so go by sea all the way. Our route was the latter
course, and at the time we went out there was only one line of
steamers, the Patrick Henderson, direct from English ports to
Rangoon. We took passage on a new vessel, the steamship Pegu,
making its third voyage. “What a strange name for a ship!” we said.
We soon learned that the name was taken from an old, ruined city of
Burma, and that all the company’s steamers bear the name of some
city, ancient or modern, in the land of Burma. So, at the very docks,
as we started Eastward, we met a name suggestive of the ancient
history of the land of our future labors. In the appointments of the
steamer we were much impressed with the fact that we had no
arrangement for heating the vessel, but every plan for thorough
ventilation. We found it very cold on board until we passed the Suez
Canal. Otherwise the appointments were every way satisfactory, and
the fare reasonable.
This good ship made but one voyage more under its Scotch
ownership. It was then sold to the Spaniards and renamed the
Alicante. This circumstance became of much interest to us at a later
date, when this ship was the first to be loaded with defeated Spanish
troops at Santiago.
The outward voyage had its many objects of interest to the
passengers going out for the first time. We sailed in plain view of the
Portuguese and Spanish coasts, but were disappointed in passing
Gibraltar at night. The next day, however, we were charmed with a
magnificent view of the Sierra Nevada Mountains in Southern Spain,
as they lifted their snowy heights into cloudless skies, and their
vineclad slopes dropped away to the level of the sea. For nearly a
whole day we sailed close by the picturesque shores of Sardinia.
Here we noted a singular confusion of the compass by reason of
being magnetized by the land. As the good ship swung off from the
southern cape of the island, it made two great curves to correct the
erratic state of the compass. We entered the harbor of Naples in the
full floodlight of a Mediterranean noon. The afternoon was spent in
the city. Our party was not favorably impressed with the gay people
in their holiday attire. It seems they have many holidays of the like
kind. In the evening we sailed southward; and as darkness closed
around us, distant Vesuvius sent its fiery glow upward on the black
mass of overhanging cloud, making a lurid night scene. In the
morning we woke in plain view of the great volcanic cone of
Stromboli, rising out of the sea. We were near the island, which
seems to have no land except the volcano itself; yet houses nestle
here and there around its base. What a choice for a home—at the
base of an actual volcano! The weather was perfect as we sailed
through the Straits of Messina, but great Mount Ætna, which we
hoped to see, was hid in clouds.
The second stop in our journey was at Port Said. The Suez
Canal is the gateway of the nations. Port Said is its northern
entrance. It is under international control, and hence its government
is less responsible than that of almost any other city. It is one of the
most wicked cities of the world. Representatives of all races are
congregated there. It is not our purpose to describe this city, but to
point out that here for the first time we had a glimpse of the Orient.
The fellaheen of Egypt loaded our ship with coal, carrying great
baskets on their heads. We arrived in the night, and the coaling
began almost immediately. My wife and I got out of our cabin before
day to go on deck and see these people at work by the light of
torches. A strange, weird sight it was to Western eyes; and their
shouting in strange tongues emphasized the fact that we had indeed
come to a strange land.
The Suez Canal is the natural dividing-line between the Western
and the Eastern civilizations, between the cold Northlands and the
perpetually tropical countries of Southern Asia. Looking westward
and northward, you find energy put to practical account; looking
eastward, you find lethargy and life no more aggressive that it must
be to keep peoples as they have been for a thousand years.
Westward you greet progress, but Eastward life has been stagnated
for ages, and only stirs as it is acted upon from the West. Westward
you have an increasing degree of prosperity and material comforts
and advantages of modern civilization, but Eastward you have such
poverty among the millions as can not be conceived by people more
favored. Westward you have civilizations never content with present
attainment; but Eastward you have peoples whose highest ideals are
only to be and to do what their fathers were and did before them.
The West seeks to produce new things, but the East condemns all
improvement for no other reason than that it is new. All this, and
much more, is suggested by the Suez Canal, from which you plunge
downward into Asiatic civilization. Climatically you are henceforth to
know only the tropics, a climate, so far as Southern Asia is
concerned, that you will come to know henceforth as dividing the
year into two seasons, “Three months very hot, and nine months
very much hotter.” At Port Said you will be informed of the change
that is just ahead of you. Whatever you may have bought in New
York or London, you will need one more article of dress at Port Said
—a helmet, to protect your head from the tropical sun. You will never
see a day in Southern Asia in which you can go forth in the noonday
sun with an ordinary hat, or without a helmet, except at your peril;
and most of the time you will wear that protection for your head from
early morning until five in the evening, or later. You will have another
indication that you are going down into the tropics. If you have made
your journey, as we did, in the colder months, the sunniest place on
the deck has been the most comfortable until you arrive at Port Said;
but there they raise double canvas over the whole ship, and from
that on, as long as you go to and fro in the tropical seas, you will
never travel a league by sea that you do not have that same double
canvas above you when the sun is in the heavens. No wonder the
Suez Canal means so much besides commerce or travel to all who
have passed through it to Southern Asia!
Through the fifteen hundred miles of the Red Sea we took our
way. Then the Gulf of Aden was traversed, and next through the
Arabian Sea our good ship bore us on our journey. The heat, like
very hot summer at home, was upon us, though we were out at sea
in December. Coming on deck one morning before other passengers
were astir, I was delighted to see the green hills of Ceylon a few
miles to our left. We had rounded the island in the night. The decks
had been scrubbed in the early morning, as usual; the ocean was
smooth, and the tropical sun flooded sea and land, while the
sweetest odor of spices filled the air. At once I thought of “Ceylon’s
spicy breezes,” but I suddenly noted that the wind was toward the
shore, which lay some miles away, and then I was prepared for the
sentiment of the chief steward who had sprinkled spices out of the
ship stores over the wet deck to please the passengers’ sense of
smell as they came forth to give their morning greetings to this
emerald isle of the Indian Ocean. In rounding Ceylon we reached our
lowest latitude, six degrees north. We were still six days’ sail from
Burma, and our course took us nearly northeast from this point. The
entire voyage from the Suez Canal to Burma was made under
cloudless skies and through calm waters. A day from Rangoon we
passed near the beautiful little Cocoa Islands, while the Andamans
showed above the horizon far to the southward. It is remarkable how
much interest there is among passengers when a ship is sighted, or
land appears on a long voyage. These Cocoa Islands are important
as being guides to vessels homeward or outward bound, and they
mark the line between the Bay of Bengal and the Gulf of Martahan.
An important lighthouse has been maintained there for the past fifty
years. The Andamans are shrouded in gloomy mystery, due to the
fact that they are used as a penal colony of criminals transported
from India. On the 31st of December, 1890, after passing several
light-ships, we came, about noon, in sight of the low-lying shores of
Burma. We had been thirty-five days from Liverpool, and were
getting weary of the sea, to say nothing of our curiosity to land in a
country new to us. But no land could be less interesting than this
shore-line of Burma, first sighted on coming in from the sea. It lies
just above the sea-level, and besides a fringe of very small
shrubbery, and here and there a cocoanut palm-tree, it is absolutely
expressionless. After lying at anchor for three hours at the mouth of
the Rangoon River, waiting for the incoming tide, we began the last
twenty miles of our journey up the broad river to the city of Rangoon.
The passengers were made up mostly of people who were
returning to Burma after a furlough in England. The anticipation of
friendly greetings and the appearance of every familiar object along
the river created a quiver of pleasant excitement among them. Our
missionary party were almost the only ones who had not special
friends in Rangoon to meet them.
Sway Dagon Pagoda

Presently all eyes were turned up the river as the second officer
called out, “There is the Great Pagoda.” Yes, this, the greatest shrine
of the Buddhist world, rising from a little hilltop just behind the main
part of the city of Rangoon, lifted its gilded and glistening form
hundreds of feet skyward. This is the first object of special
importance that is looked for by every traveler going up the Rangoon
River. It is seen before any public building comes into view. But
presently the smoke from the great chimneys of the large rice mills of
Rangoon appeared, and then the city was outlined along a river
frontage of two or three miles. The city has no special attractions, as
viewed from the harbor; but the whole river presents an animated
scene, always interesting even to any one familiar with it, but full of
startling surprises to the newcomer to the East. With the single
exception of Port Said, our missionary party had seen nothing of
Oriental life. The panoramic view of that river and shore life seen on
that last day of 1890 will remain a lifetime in the minds of our party.
Steamers of many nations and sailing-vessels under a score of flags,
native crafts of every description, steam launches by the dozen, and
half a thousand small native boats of a Chinese pattern, called
“sampans,” moved swiftly about the river, while two or three
thousand people crowded the landing and the river front. It is
possible that half a hundred nationalities were represented in that
throng, but to us strangers there were only two distinctions to be
made out clearly: a few men and women with fair skins, and the
remainder of the multitude men of darker hue. “Europeans and
natives” is the general distinction used in all India.
Some incidents at such moments in our lives, as our landing in
this strange country, make profound impressions far above their
actual importance. It was just six o’clock in the evening as we made
fast to the wharf. Suddenly, as I faced the new world life of labor just
before me, and began to contrast it with that of the past, I
remembered that just eleven years before, on that day and at that
hour, allowing for difference of latitude, I stepped off the cars in a
college town, and parted with my old life as a farmer boy for the new
life of a college student. A great change that proved to be, and this
was destined to prove even more in contrast with life hitherto. The
curious circumstance was that the two transitions corresponded by
the year and hour.
I awoke suddenly to the fact of great loneliness. There were
multitudes of people, but in the whole company not a familiar face.
There were some whose names we had heard, and they were ready
to give us a cordial welcome as fellow-workers, but we did not know
them from all the others in the throng in whose thoughts we had no
place. For myself, I have never had a more lonely moment, even
when unattended in the Burma jungles or lost on the mountains at
night.
Another incident, of a painful kind, occurred. As I stood beside
the ship’s doctor, who had been coming and going to India for thirty
years, he volunteered information of the people who were boarding
the ship to greet expected friends. One young lady passenger was
greeted by her sister, whose husband stood by her side. She was a
fair English lady; he was a tall, well-proportioned man of good
features, but he was very dark. The doctor said: “That young lady is
destined to a great disappointment. Her sister is married to a
Eurasian, and she, as an English girl, will have no social recognition
among English people here because she has that Eurasian
relationship.” To my inquiries of interest, he said many things about
these people, in whose veins flow the blood of European and Asiatic,
concluding with the following slander on these people, “They inherit
the vices of both Europeans and Asiatics and the virtues of neither.” I
refer to this expression here to show how such unjust expressions
fall from careless tongues; for I have heard it scores of times,
breathing out unkind, even cruel injustice. It is a slander that is not
often rebuked with the energy its injustice calls for. As I will discuss
this people in another chapter, I only say here that for ten years I
have been connected with them, and while they have their
weaknesses, this charge against them is entirely groundless.
We were presently greeted by the small band of Methodist
missionaries and some of their friends, and taken immediately to our
Girls’ School in the heart of the town. Here we rested in easy-chairs
of an uncouth pattern, but which we have hundreds of times since
had occasion to prove capable of affording great comfort. While
resting and making the acquaintance of Miss Scott, our hostess, an
agent of the Woman’s Foreign Missionary Society, I was impressed
with several features of our new surroundings. Though it was New-
Year’s Eve, the whole house was wide open, and three sides of the
sitting-room had open venetian blinds instead of walls, to let in the
air.
Then we were quickly conscious of the noise, mostly of human
voices, speaking or shouting strange speech in every direction,
which the wooden open-plank house caught up much as a violin
does its sound, and multiplied without transferring them into music.
We came, by later painful experiences, to know that one of the
enemies of nerves and the working force of the missionary in
Rangoon is the ceaseless noise from human throats that seems
inseparable from this Oriental city. I have been in some other noisy
cities, but, as Bishop Thoburn once remarked, our location in
Rangoon was “the noisiest place in the world.” Before these thoughts
had taken full possession of our minds, we were greeted by another
surprise. As we leaned back in the easy-chairs and our eyes sought
the high ceiling of the room, there we saw small lizards moving
about, sometimes indeed stationary, but more often running or
making quick leaps as they caught sluggish beetles or unsuspecting
flies from the ceiling. We counted nine of them in plain view,
seemingly enjoying themselves, unmindful of the presence of the
residents of the building or the nerves or tastes of the new arrivals.
A watch-night service was held that night intended for sailors
and soldiers especially, to which I went, while my wife remained and
rested at the school with our children. At the service I saw for the first
time what is so common in all like gatherings in Eastern cities, the
strange mingling of all people who speak the English language.
Being a seaport, the sailors from every European land were present,
and, so far as they can be secured, attend this wholesome service,
while the soldiers from the garrison come in crowds, and others
interested in these meetings are there also. Every shade of
Eurasians was present. Some of the people whom I saw that night
for the first time became my friends and co-laborers in the Church
and mission for the entire time of which I write. Late that night, or in
the earliest hour of the new year, I fell asleep with my latest
conscious thought, “We are in Burma.”
CHAPTER II
First Year in Burma

W E were wakened early on January 1, 1891, by the harsh


cawing of a myriad of crows, which roost in the shade-trees of
the public streets and private yards. We came afterwards to know
these annoying pests, that swarm over Rangoon all day long, as a
tribe of thieves full of all cunning and audacity. The first exhibition of
their pilfering given us, was that first morning when the early tea and
toast, always brought to you on rising in India, was passed into our
room and placed in reach of the children. The crows had been
perched on the window-sill before this, restlessly watching us within
the room. But on our turning for a moment from the tray on which the
toast was placed, the crows swooped upon it, and carried it off out of
the window. This is but a sample of the audacious annoyance
suffered from their beaks and claws continually. They are in country
places also, but not so plentifully as here in the cities, where they
literally swarm. Were it to our purpose we could write pages of these
petty and cunning robberies of which they are guilty. A very common
sight is, when a coolie is going through the streets with a basket of
rice on his head, to see the crows swoop down and fill their mouths
with the rice, and be off again before the man knows their intention,
or has time even to turn around. It must have been some such sight
as this in ancient Egypt, familiar to Pharaoh’s baker, that caused him
to dream of the birds eating the bread out of the basket that he
carried on his head, and that foreshadowed the dire results to
himself. Those “birds” must have been “crows” of the Rangoon
species.
I could not wait long that first morning in Rangoon, and the first
of a new year, to get out into the streets astir with human life. I took
my first impression of many specimens of humanity that passed in
view. While the common distinctions in dress, complexion, manners,
and occupations, which mean so much when you come to know their
significance, were not recognized in this first view of the people, I did
get a very definite impression of two classes—one well formed and
well fed, and the other class, those poor weaklings, mostly of the
depressed peoples of India, who migrate to Burma. Of the latter, I
wrote at the time to friends in America, that they were specimens of
the human race that had about run their course, and must die away
from sheer weakness. Later conclusions do not differ materially from
this first decision. But I did learn later that the fine-looking people of
strong physique were Burmese, and that the province of Burma,
generally, has very few peoples of any race that compare in
feebleness with some of the immigrants from India that flock into the
cities, such as Rangoon. It is chiefly what the traveler sees in coast
towns like Rangoon, which leads so many transient passers-by to
wrong conclusions concerning Oriental countries. In Rangoon, many
other peoples are more in evidence than the Burmese.
After that early walk and breakfast, which came about ten
o’clock, the usual time, I met with Rev. Mr. Warner, and took in
charge the affairs of our mission. It is a simple thing for a preacher to
go from one pastoral charge to another in America, in every respect
very much like the Church and community he has always served; but
it is entirely different to go to a distant and unfamiliar country, and
take up work essentially different from anything you ever had to do
with before. Then, at home it is the custom for each man to be
occupied with some one specific work and its obligations; but on the
mission-field, such as Burma has been until now, there is such a
variety of interests as loads every missionary with the work that
ought to be distributed between two or three. That morning I learned
that we had an English Church in Rangoon which supported its own
pastor; an English school that numbered nearly two hundred pupils,
and an Orphanage for the poor Eurasians and Anglo-Indian children.
There was also a work among the seamen that visited the port. A
woman’s workshop had been founded some time before for helping
the poor Eurasian, and other women, to earn a living with the needle.
There was also preaching going on among the Tamils and Telegus,
some converts and a fair day-school being conducted among them.
This work was mostly in Rangoon; but some preaching was done in
the villages round about, and one exhorter was holding a little
congregation of Tamils at Toungoo, one hundred and sixty miles
north from Rangoon. A further account of Methodism will be given
later, and it is only necessary here to tell how the work appeared to
me that morning when I began my labors in Burma.

Methodist Church, Rangoon

We had a modest wooden church and also a parsonage, a fair-


sized building for the school, and another of equal size for the
Orphanage. Besides these buildings, we had a couple of residence
bungalows, intended for rental for the support of the Orphanage, but
for which we were badly in debt. Considering the small size of the
mission, our debts were large and troublesome. They were incurred
out of the emergencies of our work, and were not the result of bad
management in any way. These debts were to be met at once, and
added much to my concern for the mission.
Another embarrassing feature of the finances of the mission was
found in this, that we had very small missionary appropriations, and
the time had been not long before when our workers in Burma had
no money from home. The beginning of the mission had been made
entirely without funds from America.
This was the more apparent when we look at the distribution of
the missionaries. I was to take the pastorate of the English Church,
and receive my salary from it; Miss Files, the principal of the Girls’
High School, had never had any salary, except what the school could
pay her; Miss Scott, principal of the Orphanage, had half salary; Miss
Perkins, the new missionary, alone had a salary from the Woman’s
Foreign Missionary Society. Mr. Warner had less than full salary,
though appointed to native work. We had, also, a number of
teachers all paid locally, and supplies in the mission-work, none of
whom received a salary from America. Here was an outline of a
situation in what was called a “self-supporting” mission-field. How to
pay debts, keep all this work going, and make advance in mission
operations with our limited money, was my greatest responsibility.
There had never been a dollar given to the mission from America for
property. The problem was easy of statement, but difficult of solution.
To plunge right into this work, my first day in the country, and
immediately become the responsible head of the district, was
beginning mission-work with vigor and without delay. I have learned
since to believe it a serious misfortune that any missionary should be
so overwhelmed with work and responsibility on entering a foreign
mission-field. All this, too, when we had yet to adjust ourselves to life
in the tropics.
We were about to prove what it meant to be suddenly dropped
down into the heart of an Oriental city, and there adjust ourselves to
the most trying conditions we had ever known. The parsonage
belonging to the English Church, which we occupied, shared the lot
with the church building. At the time the church and parsonage was
to be built, it was the policy of the Government to give a grant of land
to any religious society for a church or parsonage. The city is
blocked out in rectangular shape, but unwisely made very narrow
and long. The blocks are eight hundred feet long by one hundred
and fifteen feet wide. Our lot included one end of a block, and was
one hundred feet deep. On this lot stood the church and parsonage,
facing the main street. When the location was chosen, it was a fairly
satisfactory site on which to have a residence, and in a Western
country, with Western conditions, it might have contained a fairly
comfortable residence; but in Rangoon the natives soon began to
crowd into poorly constructed buildings all around the parsonage,
and the filth, that so rapidly accumulates in an Oriental city, piled up
everywhere. The only sewerage was in open ditches that ran on
three sides of our residence. The stench of these sewers was ever
present in our nostrils, and especially offensive in the rainless
season. But the worst condition was the incessant noise made by
the natives. This neighborhood was occupied almost entirely by
Madassis, who have harsh, strident voices, and speak with a
succession of guttural sounds. They are always shouting, and
quietness is almost unknown to them. They quarrel incessantly. At
the time we lived in this locality there were six hundred of these
noisy people living within a hundred yards of the parsonage. They
kept no hours for rest. All day and all night the noise went on.
Sometimes, of course, they slept, and the native can sleep in bedlam
and not even dream. But there are hundreds astir at all hours of the
day and night. Then there were thousands of passers-by who at all
hours added their voices to the din. Besides, a heavy traffic was
carried on on two sides of us. The streets were metaled, and every
wheel and hoof added to the uproar.
The parsonage was of the uncouth architectural plan
characteristic of Burma, roomy and arranged well enough for comfort
in that country, had the surroundings been endurable. But being
placed upon posts, some ten feet from the ground to the first floor,
and the floor and walls being made of single thicknesses of teak
planks, these multitudinous sounds of the neighborhood were
gathered up and multiplied as a violin gathers the sounds of the
strings, and this discordant din was poured into our ears. Added to
all this noise was the intense heat, which even in the coolest part of
the year is very great, and you have conditions of life that tax you to
the utmost. My wife and I have pretty steady nerves; but in the
thirteen months we tried to live in the parsonage we did not have
more than twenty nights of unbroken sleep. Just after we entered
this residence, we received our first mail from home, and in the
papers to hand we read the speech of the senior missionary
secretary at the Missionary Committee meeting in Boston, held at
the time we were sailing from New York, in which he dwelt at length,
“on the luxury of missionary life in India.” I promptly sent him an
invitation to spend the last week preceding the next Missionary
Committee meeting in our guest-chamber, overlooking and
overhearing all that happens among this noisy throng of Tamils. I felt
that I had learned more of the actual conditions of life in an Oriental
city in one week, than this good man had learned in all the years of
his missionary official life. He did not accept the invitation.
Natives of Burma
When one is overworked with unusual duties that tax nerves to
the utmost, and then lives in perpetual noise and heat day and night,
he has the ideal conditions for a short missionary career. We were to
prove all that this meant within one year from landing in the country.
Surprises and disappointments in the working force of a mission,
at least in its earlier and less well organized state, occur with great
frequency. Within less than three months, my missionary colleague,
Mr. Warner, and his wife left us, and took work in another mission.
He had been with our mission less than two years, having been sent
out from America. It may be said here that such changes, so early in
a missionary’s career, do not generally argue well for the stability of
purpose or settled convictions of the missionary, and do not usually
help the mission to which a change is made. But in our case it added
to our difficulties, as the Burmese work, to begin which Mr. Warner
was appointed, did not get started for some years afterward. There
was no other man to take up his work, and there could be no one
supplied for some time. This situation, coming so soon after I took up
the work with the high hopes of a new beginner, added to the
complications.
The heat increased from January onward. The work became
very laborious, largely owing to failure to get rest at night. In May, I
began to be troubled with a strange numbness in my arms. This
gradually spread to most of the muscles of the body, and began to
affect my head seriously. At the same time, the heat, especially any
direct ray of the sun, caused very distressing nervous symptoms.
Having all my life worked hard, and having a body that had stood
almost all kinds of strain and seemed none the worse for it, I at the
beginning expected to throw off these symptoms quickly. But when I
did not succeed in this, I consulted physicians and found that they
were puzzled as much as myself. Had it been possible to go to some
cooler place and take rest at the beginning of this disorder, it is likely
that I could have met the difficulty and overcome it quickly; but there
was no chance to leave the work, no place to go to, and no one to
relieve me. Steadily for five months the trouble increased, until it was
impossible even to read in an attentive way, though under the
excitement of a Sabbath’s congregation I could talk to the people. In
October, only a little over nine months after landing in Burma, Bishop
Thoburn peremptorily ordered me to the hills of India for a change.
He temporarily supplied my place at Rangoon.
I left Rangoon on the evening of the 10th of October on this
painful flight for health. My wife remained and did hard service, all
too hard as the case proved, to give the English congregations
attention during my absence. This early flight from my work with the
uncertainties of my ailment, and the long distance to the Indian Hills,
which as we supposed at the time, was the nearest place to get
above the heat of the plains, and the condition of the work in my
absence, and the added burden to my wife, all combined to give the
occasion a serious aspect.
I took passage on a little vessel of the British India Steam
Navigation Company, which has a large fleet of steamers in these
tropical waters. I traveled after this many times on steamers of this
company, and always found the trip of four days to Calcutta very
interesting. The sea breeze modifies the heat until you can be in
comparative comfort. The officers are usually courteous, but
somewhat reserved, for the most part. Perhaps this show of dignity
is assumed to support the important office they hold. It may be that it
is a National characteristic also. The engineers, who number about
the same on each ship as the officers, and have about as much
responsibility, and are equally capable men, are usually very free
and sociable. The officers are generally Englishmen, and the
engineers Scotchmen. I have been greatly surprised to find how
approachable most Scotchmen are. Being of a social disposition
myself, I usually get in touch with both classes; but I have secured
the most friendly response from the Scotch. This has been generally
true on land also.
The Bay of Bengal is a stormy water during the monsoon, from
May until October. At the latter time the wind turns into the northeast,
and one or two cyclones generally form as it turns the rain currents
back to the southwest, from whence they came. Our captain was
nervous as we rounded the land and made for the open sea, lest we
be met by a cyclone. But instead of a storm, the sea was as smooth
as a sea of glass all the way to the mouth of the Hoogli River, where

You might also like