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

Programming for Problem Solving E Balagurusamy - The full ebook set is available with all chapters for download

The document promotes the book 'Programming for Problem Solving' by E. Balagurusamy, which covers essential programming concepts using the C language. It includes links to download the book and other related texts, along with a brief overview of the author's credentials and the book's structure. The content is designed to guide readers through various programming fundamentals, control structures, and memory management techniques.

Uploaded by

denebtamuna1
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
21 views

Programming for Problem Solving E Balagurusamy - The full ebook set is available with all chapters for download

The document promotes the book 'Programming for Problem Solving' by E. Balagurusamy, which covers essential programming concepts using the C language. It includes links to download the book and other related texts, along with a brief overview of the author's credentials and the book's structure. The content is designed to guide readers through various programming fundamentals, control structures, and memory management techniques.

Uploaded by

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

Visit ebookmass.

com to download the full version and


explore more ebook or textbook

Programming for Problem Solving E Balagurusamy

_____ Click the link below to download _____


https://ebookmass.com/product/programming-for-problem-
solving-e-balagurusamy/

Explore and download more ebook or textbook at ebookmass.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Problem Solving and Python Programming E. Balagurusamy

https://ebookmass.com/product/problem-solving-and-python-programming-
e-balagurusamy/

Computer Programming E. Balagurusamy

https://ebookmass.com/product/computer-programming-e-balagurusamy/

Programming in C E. Balagurusamy

https://ebookmass.com/product/programming-in-c-e-balagurusamy/

Programming in ANSI C 6th Edition E. Balagurusamy

https://ebookmass.com/product/programming-in-ansi-c-6th-edition-e-
balagurusamy/
Programming and Problem Solving with Python Ashok Namdev
Kamthane

https://ebookmass.com/product/programming-and-problem-solving-with-
python-ashok-namdev-kamthane/

Python Programming: Using Problem Solving Approach 1st


Edition Reema Thareja

https://ebookmass.com/product/python-programming-using-problem-
solving-approach-1st-edition-reema-thareja/

Introduction to Programming with Java: A Problem Solving


Approach 3rd Edition John Dean

https://ebookmass.com/product/introduction-to-programming-with-java-a-
problem-solving-approach-3rd-edition-john-dean/

MATLAB: A Practical Introduction to Programming and


Problem Solving 4th Edition Stormy Attaway

https://ebookmass.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-4th-edition-stormy-attaway/

Data Structures E. Balagurusamy

https://ebookmass.com/product/data-structures-e-balagurusamy/
PROGRAMMING
fOR
PRObleM SOlvING
Gujarat Technological University - 2018
About the Author

E Balagurusamy, is presently the Chairman of EBG Foundation, Coimbatore. In the past he has also held
the positions of member, Union Public Service Commission, New Delhi and Vice-Chancellor, Anna University,
Chennai. He is a teacher, trainer and consultant in the fields of Information Technology and Management.
He holds an ME (Hons) in Electrical Engineering and PhD in Systems Engineering from the Indian Institute
of Technology, Roorkee. His areas of interest include Object-Oriented Software Engineering, E-Governance:
Technology Management, Business Process Re-engineering and Total Quality Management.
A prolific writer, he has authored a large number of research papers and several books.
A recipient of numerous honors and awards, he has been listed in the Directory of Who's Who of Intellectuals
and in the Directory of Distinguished Leaders in Education.
PROGRAMMING
fOR
PRObleM SOlvING
Gujarat Technological University - 2018

E Balagurusamy
Chairman
EBG Foundation
Coimbatore

McGraw Hill Education (India) Private Limited


CHENNAI

McGraw Hill Education Offices


Chennai New York St Louis San Francisco Auckland Bogotá Caracas
Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal
San Juan Santiago Singapore Sydney Tokyo Toronto
McGraw Hill Education (India) Private Limited
Published by McGraw Hill Education (India) Private Limited
444/1, Sri Ekambara Naickr Industrial Estate, Alapakkam, Porur, Chennai-600 116

Programming for Problem Solving


Copyright © 2019 by McGraw Hill Education (India) Private Limited.
No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission of
the publishers. The program listings (if any) may be entered, stored and executed in a computer system, but they may not
be reproduced for publication.
This edition can be exported from India only by the publishers,
McGraw Hill Education (India) Private Limited.
Print Edition
ISBN (13 digit): 978-93-5316-278-8
ISBN (10 digit): 93-5316-278-5
E-book Edition
ISBN (13 digit): 978-93-5316-279-5
ISBN (10 digit): 93-5316-279-3
1 23456789 D101417 22 21 20 19 18
Printed and bound in India.
Director—Science & Engineering Portfolio: Vibha Mahajan
Senior Portfolio Manager—Science & Engineering: Hemant K Jha
Associate Portfolio Manager —Science & Engineering: Tushar Mishra
Production Head: Satinder S Baveja
Copy Editor: Taranpreet Kaur
Assistant Manager—Production: Suhaib Ali
General Manager—Production: Rajender P Ghansela
Manager—Production: Reji Kumar

Information contained in this work has been obtained by McGraw Hill Education (India), from sources believed to be
reliable. However, neither McGraw Hill Education (India) nor its authors guarantee the accuracy or completeness of any
information published herein, and neither McGraw Hill Education (India) nor its authors shall be responsible for any errors,
omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw
Hill Education (India) and its authors are supplying information but are not attempting to render engineering or other
professional services. If such services are required, the assistance of an appropriate professional should be sought.

Typeset at The Composers, 260, C.A. Apartment, Paschim Vihar, New Delhi 110 063 and printed at

Cover Printer:
Cover Designer: APS Compugraphics
Cover Image Source: Shutterstock
Visit us at: www.mheducation.co.in
Write to us at: [email protected]
CIN: U22200TN1970PTC111531
Toll Free Number: 1800 103 5875
Preface

P
rogramming for Problem Solving requires a deep understanding of C. C is a powerful, flexible, portable
and elegantly structured programming language. Since C combines the features of high-level language
with the elements of the assembler, it is suitable for both systems and applications programming. It
is undoubtedly the most widely used general-purpose language today in operating systems, and embedded
system development. Its influence is evident in almost all modern programming languages. Since its
standardization in 1989, C has undergone a series of changes and improvements in order to enhance the
usefulness of the language.

Organization of the Book


Programming for Problem Solving starts with an Introduction to Computer Programming, Chapter 2 discusses
fundamentals of C. Control Structures in C is presented in Chapter 3. Chapter 4 deals with Arrays and
Strings. Chapter 5 discusses Functions. In Chapter 6 students can study Pointers. While Chapter 7 details
Structure. Dynamic Memory Allocation is discussed in Chapter 8. Chapter 9 details on File Management.

Salient Features of the Book


∑ Learning Objectives
∑ Key Concepts
∑ Content Tagged with LO
∑ Worked Out Problems
∑ Tips
∑ Closing Vignette
∑ Review Exercises – True False, Fill in the blanks, Questions, Programming Exercises – categorized into
LO and Difficulty level (E for Easy, M for Medium and H for High)

Acknowledgements
I owe special thanks to the entire team of McGraw Hill Education India.
A note of acknowledgement is due to the following reviewers for their valuable feedback.

Ms. Kalpana Mudaliar Gandhinagar Institute of Technology, Gandhinagar, Gujarat


H K Patnaik Kalinga Institute of Industrial Technology, KIIT University, Bhubaneswar
T V Gopal College of Engineering, Anna University, Chennai, Tamil Nadu
Unnati Nitin Chaudhari Tolani Maritime Institute, Pune, Maharashtra
Tanveer Ahmed Jamia Millia Islamia, Delhi
Ravindra Divekar KJ Somaiya College of Engineering, Mumbai, Maharashtra
SC Dutta Birsa Institute of Technology, Sindri, Dhanbad, Jharkhand
D Lakshmi Adithya Institute of Technology, Coimbatore, Tamil Nadu
vi Preface

This book is my sincere attempt to make a footprint on the immensely vast and infinite sands of knowledge.
I would request the readers to utilize this book to the maximum extent.
E Balagurusamy

Publisher’s Note
McGraw Hill Education (India) invites suggestions and comments from you, all of which can be sent to info.
[email protected] (kindly mention the title and author name in the subject line).
Piracy-related issues may also be reported.
Contents

About the Author ii


Preface v

1. Introduction to Computer and Programming 1


Learning Objectives 1
Introduction 1
Generations of Computers 2
Classification of Computers 5
Basic Anatomy of a Computer System 7
Input Devices 8
Processor 9
Output Devices 10
Memory Management 12
Types of Computer Software 13
Overview of Operating System 14
MS Word 19
MS Excel System 21
MS Powerpoint System 22
Networking Concepts 23
Network Topologies 25
Network Protocols and Software 29
Decimal System 31
Binary System 32
Hexadecimal System 33
Octal System 34
Conversion of Numbers 35
Binary Arithmetic Operations 44
Logic Gates 52
Programming Languages 55
viii Contents

Translator Programs 58
Problem-Solving Techniques 59
Using the Computer 70
Learning Outcomes 70
Key Concepts 71
Review Questions 73
Discussion Questions 84

2. Fundamentals of C 87
Learning Objectives 87
History of C 87
Importance of C 89
Sample Program 1: Printing a Message 89
Sample Program 2: Adding Two Numbers 92
Sample Program 3: Interest Calculation 93
Sample Program 4: Use of Subroutines 95
Sample Program 5: Use of Math Functions 96
Basic Structure of C Programs 97
Programming Style 98
Executing a ‘C’ Program 99
UNIX System 99
MS-DOS System 102
Key Concepts 102
Always Remember 103
Review Questions 103
Debugging Exercises 105
Programming Exercises 105

3. Control Structure in C 107


Learning Objectives 107
Introduction 107
Decision Making with if Statement 108
Simple If Statement 108
The If.....Else Statement 111
Nesting of If....Else Statements 114
The Else If Ladder 117
The Switch Statement 121
The ? : Operator 125
The goto Statement 129
Key Concepts 132
Contents ix

Always Remember 132


Brief Cases 132
Review Questions 137
Debugging Exercises 141
Programming Exercises 141

4. Array & String 145


Learning Objectives 145
Introduction 145
One-Dimensional Arrays 147
Declaration of One-dimensional Arrays 148
Initialization of One-dimensional Arrays 151
Two-Dimensional Arrays 156
Initializing Two-dimensional Arrays 161
Multi-dimensional Arrays 168
Dynamic Arrays 169
More About Arrays 170
Declaring and Initializing String Variables 170
Reading Strings from Terminal 171
Writing Strings to Screen 177
Arithmetic Operations on Characters 181
Putting Strings Together 183
Comparison of Two Strings 184
String-Handling Functions 184
Table of Strings 190
Other Features of Strings 192
Key Concepts 192
Always Remember 193
Brief Cases 194
Review Questions 210
Debugging Exercises 214
Programming Exercises 215

5. Functions 220
Learning Objectives 220
Introduction 220
Need for User-Defined Functions 221
A Multi-Function Program 221
Elements of User-Defined Functions 224
x Contents

Definition of Functions 224


Return Values and Their Types 227
Function Calls 228
Function Declaration 229
Category of Functions 231
No Arguments and No Return Values 231
Arguments but No Return Values 233
Arguments with Return Values 236
No Arguments but Returns a Value 241
Functions that Return Multiple Values 242
Nesting of Functions 243
Recursion 244
Passing Arrays to Functions 245
Passing Strings to Functions 250
The Scope, Visibility and Lifetime of Variables 251
Multifile Programs 260
Key Concepts 262
Always Remember 262
Brief Cases 263
Review Questions 266
Debugging Exercises 270
Programming Exercises 270

6. Pointers 273
Learning Objectives 273
Introduction 273
Understanding Pointers 274
Accessing the Address of a Variable 276
Declaring Pointer Variables 277
Initialization of Pointer Variables 278
Accessing a Variable Through its Pointer 279
Chain of Pointers 281
Pointer Expressions 282
Pointer Increments and Scale Factor 284
Pointers and Arrays 284
Pointers and Character Strings 288
Array of Pointers 290
Pointers as Function Arguments 291
Functions Returning Pointers 294
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Contents xi

Pointers to Functions 295


Pointers and Structures 297
Troubles with Pointers 299
Key Concepts 300
Always Remember 300
Brief Cases 301
Review Questions 306
Debugging Exercises 309
Programming Exercises 309

7. Structure 311
Learning Objectives 311
Introduction 311
Defining a Structure 312
Declaring Structure Variables 313
Accessing Structure Members 315
Structure Initialization 316
Copying and Comparing Structure Variables 318
Operations on Individual Members 320
Arrays of Structures 320
Arrays within Structures 323
Structures within Structures 324
Structures and Functions 326
Unions 329
Size of Structures 330
Bit Fields 330
Key Concepts 333
Always Remember 333
Brief Cases 334
Review Questions 338
Debugging Exercises 341
Programming Exercises 341

8. Dynamic Memory Allocation 344


Learning Objectives 344
Introduction 344
Dynamic Memory Allocation 344
Allocating a Block of Memory: malloc 345
Allocating Multiple Blocks of Memory: calloc 347
xii Contents

Releasing the Used Space: free 348


Altering the Size of a Block: realloc 348
Concepts of Linked Lists 350
Advantages of Linked Lists 353
Types of Linked Lists 354
Pointers Revisited 354
Creating a Linked List 356
Inserting an Item 360
Deleting an Item 363
Application of Linked Lists 365
Key Concepts 365
Always Remember 366
Brief Cases 366
Review Questions 372
Debugging Exercises 374
Programming Exercises 374

9. File Management 376


Learning Objectives 376
Introduction 376
Defining and Opening a File 377
Closing a File 378
Input/Output Operations on Files 379
Error Handling During I/O Operations 385
Random Access to Files 387
Command Line Arguments 394
Key Concepts 396
Always Remember 396
Review Questions 397
Debugging Exercises 398
Programming Exercises 398
Roadmap to the Syllabus
Programming For Problem Solving
Code: 3110003

Introduction to computer and programming: Introduction, Basic block diagram and functions of various
components of computer, Concepts of Hardware and software, Types of software, Compiler and interpreter,
Concepts of Machine level, Assembly level and high level programming, Flowcharts and Algorithms

GO TO Chapter 1 Introduction to Computer and Programming

Fundamentals of C: Features of C language, structure of C Program, comments, header files, data types,
constants and variables, operators, expressions, evaluation of expressions, type conversion, precedence
and associativity, I/O functions

GO TO Chapter 2 Fundamentals of C

Control structure in C: Simple statements, Decision making statements, Looping statements, Nesting of
control structures, break and continue, goto statement

GO TO Chapter 3 Control Structure in C

Array & String: Concepts of array, one and two dimensional arrays, declaration and initialization of arrays,
string, string storage, Built-in-string functions
Recursion: Recursion, as a different way of solving problems. Example programs, such as Finding
Factorial, Fibonacci series, Ackerman function etc. Quick sort or Merge sort.

GO TO Chapter 4 Array & String


xiv Roadmap to the Syllabus

Functions: Concepts of user defined functions, prototypes, definition of function, parameters, parameter
passing, calling a function, recursive function, Macros, Pre-processing

GO TO Chapter 5 Functions

Pointers: Basics of pointers, pointer to pointer, pointer and array, pointer to array, array to pointer, function
returning pointer

GO TO Chapter 6 Pointers

Structure: Basics of structure, structure members, accessing structure members, nested structures, array
of structures, structure and functions, structures and pointers

GO TO Chapter 7 Structure

Dynamic memory allocation: Introduction to Dynamic memory allocation, malloc, calloc

GO TO Chapter 8 Dynamic Memory Allocation

File management: Introduction to file management and its functions

GO TO Chapter 9 File Management


Introduction to
Chapter
Computer and
Programming 1
LEARNING OBJECTIVES
LO 1.1 Identify the various generations of computers
LO 1.2 Classify computers on the basis of different criteria
LO 1.3 Describe the computer system
LO 1.4 Classify various computer software
LO 1.5 Discuss various operating systems
LO 1.6 Discuss Microsoft software
LO 1.7 Know various networking concepts and protocols
LO 1.8 Identify the various positional number systems
LO 1.9 Carry out number conversions from one number system to another
LO 1.10 Explain how binary arithmetic operations are performed
LO 1.11 Describe primary logic gates
LO 1.12 Discuss various levels of programming languages
LO 1.13 Know various problem solving techniques and computer applications

introduction
A computer is an electronic machine that takes input from the user, processes the given input and generates
output in the form of useful information. A computer accepts input in different forms such as data, programs
and user reply. Data refer to the raw details that need to be processed to generate some useful information.
Programs refer to the set of instructions that can be executed by the computer in sequential or non-
sequential manner. User reply is the input provided by the user in response to a question asked by the
computer.
A computer includes various devices that function as an integrated system to perform several tasks
described above (Fig. 1.1). These devices are:
Central Processing Unit (CPU)
It is the processor of the computer that is responsible for controlling and executing instructions in the computer.
It is considered as the most significant component of the computer.
2 Programming for Problem Solving

Monitor
It is a screen, which displays information in visual form, after receiving the video signals from the computer.
Keyboard and Mouse
These are the devices, which are used by the computer, for receiving input from the user.

Fig. 1.1 The components of computer

Computers store and process numbers, letters and words that are often referred to as data.
l How do we communicate data to computers?
l How do the computers store and process data?
Since the computers cannot understand the Arabic numerals or the English alphabets, we should use
some ‘codes’ that can be easily understood by them.
In all modern computers, storage and processing units are made of a set of silicon chips, each contain-
ing a large number of transistors. A transistor is a two-state device that can be put ‘off’ and ‘on’ by passing
an electric current through it. Since the transistors are sensitive to currents and act like switches, we can
communicate with the computers using electric signals, which are represented as a series of ‘pulse’ and
‘no-pulse’ conditions. For the sake of convenience and ease of use, a pulse is represented by the code ‘1’
and a no-pulse by the code ‘0’. They are called bits, an abbreviation of ‘binary digits’. A series of 1s and
0s are used to represent a number or a character and thus they provide a way for humans and computers
to communicate with one another. This idea was suggested by John Von Neumann in 1946. The numbers
represented by binary digits are known as binary numbers. Computers not only store numbers but also
perform operations on them in binary form.
In this chapter, we discuss how the numbers are represented using what are known as binary codes, how
computers perform arithmetic operations using the binary representation, how digital circuits known as logic
gates are used to manipulate data, how instructions are designed using what are known as programming
languages and how algorithms and flow charts might help us in developing programs.

generations of computers
The history of computer development is often discussed in terms of different LO 1.1
generation of computers, as listed below. Identify the various
l First generation computers generations
l Second generation computers of computers
l Third generation computers
l Fourth generation computers
l Fifth generation computers
Introduction to Computer and Programming 3

These computers used the vacuum tubes


technology (Fig. 1.2) for calculation as well as
for storage and control purposes. Therefore,
these computers were also known as vacuum
tubes or thermionic valves based machines.
Some examples of first generation computers
are ENIAC, EDVAC, EDSAC and UNIVAC.
Advantages
l Fastest computing devices of their time.
l Able to execute complex mathematical
problems in an efficient manner.
Disadvantages
l These computers were not very easy to
program being machine dependent.
l They were not very flexible in running
different types of applications as designed
for special purposes.
l The use of vacuum tube technology made
these computers very large and bulky and
also required to be placed in cool places.
l They could execute only one program at a
time and hence, were not very productive.
l They generated huge amount of heat and
hence were prone to hardware faults.
Fig. 1.2 A vacuum tube

These computers use transistors in place of vacuum tubes in building


the basic logic circuits. A transistor is a semiconductor device that is
used to increase the power of the incoming signals by preserving the
shape of the original signal (Fig. 1.3).
Some examples of second generation computers are PDP-8, IBM
1401 and IBM 7090.
Advantages
l Fastest computing devices of their time.
l Easy to program because of the use of assembly language.
l Small and light weight computing devices.
l Required very less power in carrying out operations.
Disadvantages
l Input and output media for these computers were not improved
to a considerable extent.
l Required to be placed in air-conditioned places. Fig. 1.3 A transistor
4 Programming for Problem Solving

l Very expensive and beyond the reach of home users.


l Being special-purpose computers they could execute only specific applications.

The major characteristic feature of third generation


computer systems was the use of Integrated Circuits
(ICs). ICs are the circuits that combine various electronic
components, such as transistors, resistors, capacitors, etc.
onto a single small silicon chip.
Some examples of third generation computers are NCR
395, B6500, IBM 370, PDP 11 and CDC 7600.
Advantages
l Computational time for these computers was usually
in nanoseconds hence were the fastest computing
devices
l Easily transportable because of their small size.
l They used high-level languages which is machine
independent hence very easy to use. Fig. 1.4 An integrated circuit
l Easily installed and required less space.
l Being able to execute any type of application (business and scientific) these were considered as
general-purpose computers.
Disadvantages
l Very less storage capacity.
l Degraded performance while executing complex computations because of the small storage capacity.
l Very expensive.

The progress in LSI and VLSI technologies led to the development of microprocessor, which became the
major characteristic feature of the fourth generation
computers. The LSI and VLSI technology allowed
thousands of transistors to be fitted onto one small silicon
chip.
A microprocessor incorporates various components
of a computer—such as CPU, memory and Input/Output
(I/O) controls—onto a single chip. Some popular later
microprocessors include Intel 386, Intel 486 and Pentium.
Some of the examples of fourth generation computers
are IBM PC, IBM PC/AT, Apple and CRAY-1.
Advantages
l LSI and VLSI technologies made them small,
cheap, compact and powerful.
l high storage capacity
l highly reliable and required very less maintenance. Fig. 1.5 The Intel P4004 microprocessor chip
Introduction to Computer and Programming 5

l provided a user-friendly environment with the development of GUIs and interactive I/O devices.
l programs written on these computers were highly portable because of the use of high-level languages.
l very versatile and suitable for every type of applications.
l required very less power to operate.
Disadvantages
l the soldering of LSI and VLSI chips on the wiring board was complicated
l still dependent on the instructions given by the programmer.

Fifth generation computers are based on the Ultra Large Scale Integration (ULSI) technology that allows
almost ten million electronic components to be fabricated on one small chip.
Advantages
l faster, cheaper and most efficient computers till date.
l They are able to execute a large number of applications at the same time and that too at a very high
speed.
l The use of ULSI technology helps in decreasing the size of these computers to a large extent.
l very comfortable to use because of the several additional multimedia features.
l versatile for communications and resource sharing.
Disadvantage
They are not provided with an intelligent program that could guide them in performing different operations.
Figure 1.6 shows a tree of computer family that illustrates the area-wise developments during the last
four decades and their contributions to the various generations of computers.

classification of computers
Computers can be classified into several categories depending on their LO 1.2
computing ability and processing speed. These include Classify computers on
l Microcomputer the basis of different
l Minicomputer criteria
l Mainframe computers
l Supercomputers
Microcomputers
A microcomputer is defined as a computer that has a microprocessor as its CPU and can perform the
following basic operations:
l Inputting — entering data and instructions into the microcomputer system.
l Storing — saving data and instructions in the memory of the microcomputer system, so that they can
be use whenever required.
l Processing — performing arithmetic or logical operations on data, where data, such as addition,
subtraction, multiplication and division.
l Outputting — It provides the results to the user, which could be in the form of visual display and/or
printed reports.
l Controlling — It helps in directing the sequence and manner in which all the above operations are
performed.
Minicomputers
A minicomputer is a medium-sized computer that is more powerful than a microcomputer. It is usually
designed to serve multiple users simultaneously, hence called a multiterminal, time-sharing system.
6 Programming for Problem Solving

Fig. 1.6 Tree of computer family


Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Other documents randomly have
different content
set a star of gas burning in her room, and left a plate of cake and
a glass of wine on the stand at her bedside.

Margaret raised herself like one who has been nearly drowned and
still catches for breath, gathered her benumbed faculties and
recollected where she was. All was quiet within the house; and
without there was stillness of another sort, a silence that was living
and aware, a sense as of thousands waking and watching. Now
and then there came from the hospital across the street some voice
of a sleepless sufferer, the long, low moan of almost exhausted
endurance, the broken cry of delirium, or the hoarse gasp of
pneumonia.

After a while these sounds became deadened, and finally lost in


another that rose gradually, deepening like the roll of the sea heard
at night.

Margaret went to her window and leaned out. The sultry air was
heavily-laden with fragrance from the flower-gardens around, and
in the sky the large stars trembled like over-full drops of a golden
shower descending through the ambient purple dusk.

That sea-roll grew nearer as she listened, and became the


measured tramp of men. Soon they appeared out of the darkness
at the left, marching steadily line after line, and company after
company, to disappear into darkness at the right. They moved like
shadows, save for that multitudinous muffled tread, and save that,
at certain points, a street-light would flash along a line of rifle-
barrels, or catch in a flitting sparkle on a spur or shoulder-strap.
Then, like a dream, they were gone; darkness and distance had
swallowed them up from sight and hearing; and again there was
that strange, live stillness, broken only by the complaining voices of
the sick.

As Margaret looked, the dim light in one of the hospital-wards


flared up suddenly and showed three men standing by a bed near
one of the windows. They lifted the rigid form that lay there, and
placed it on a stretcher; two of the men bore it out, and the light
was lowered again, After a little while the men appeared outside
bearing that white and silent length between them, through the
dew and the starlight, and were lost from sight behind the trees.
When they returned, they walked side by side; and what they had
carried out they brought not back again.

The watcher's heart sent out a cry: "O Father in heaven! see how
thy creatures suffer."

In the excitement of the last part of her journey, and the


exhaustion following it, she had almost forgotten her object in
coming; but this sight brought it all back. She remembered, too,
that she had been dropping into the old way of taking all the
burden on her own shoulders; and even in crying out for pain, she
recollected the way of comfort. How sweet the restfulness of that
recollection! As though a child, wandering from home, lost, weary,
and terrified, should all at once see the hearth-light shining before
him, and hear the dear familiar voices calling his name. She
thought over the lessons learned during that blessed retreat, that
Mecca toward which henceforth her thoughts would journey
whenever her soul grew faint by the way. The half-forgotten trust
came back. Who but He who had set the tangles of this great
labyrinth could lead the way out of it? Who but He whose hand had
strung the chords of every human heart could ease their straining,
and bring back harmony to discord? Where but with Him, the
centre of all being, could we look for those who are lost to us on
earth?

When, long after sunrise, Mrs. Black entered her visitor's chamber,
she found Margaret kneeling by the window, fast asleep, with her
head resting on the sill.

There was plenty of news and excitement that morning. All


communication with the North was cut off, the President and his
family had come rushing in at midnight from their country-seat, and
there was fighting going on only a few miles out of town. It was
altogether probable that the Confederates would be in the city
before night.

Mrs. Black told all this with such an air of satisfaction in the midst
of her terror that Margaret made some allowance for embellishment
in the story. Evidently the good woman enjoyed a panic, and was
willing to be frightened to the very verge of endurance for the sake
of having it to tell of afterward. She went about in a sort of
delighted agony, gathering up her spoons and forks, and giving
little shrieks at the least unusual sound.

"If they should bombard the city, my dear," she said, "we can go
down cellar. I have an excellent cellar. It is almost certain that they
will come. We must be in a strait when the treasury-clerks come
out. And such a sight! They passed here just before I went up to
call you, all in their shirt-sleeves, and looking no more like soldiers,
dear, than I do this minute. Half of them carried their rifles over the
wrong shoulder, and seemed scared to death lest they should go
off. And no wonder; for the way the barrels slanted was enough to
make you smile, even if there were a bomb-shell whizzing past
your nose. The muzzles looked all ways for Sunday, so to speak.
There were little boys with them, too. I don't see where their pas
and mas were, if they've got any. It's a sin and shame. Do eat
some more breakfast, pray! You may as well have a full stomach;
for if we should be obliged to hide in the cellar, we might not dare
come up to get a mouthful for twenty-four hours. I do hope it
won't be a long siege. If they've got to come in, let'em come. I'm
sure they would be too much of gentlemen to molest a houseful of
defenceless females. As for poor Mr. Black, he doesn't count.
Though he is my husband, I have seen braver men, not to speak of
women. I had to threaten him, this morning, within an inch of his
life, to prevent him from running a Confederate flag out of the
window. He keeps one in his trunk, in case it should be needed. He
declared he heard firing in the avenue. Bless me! What is that?"
"One of the servants has broken a dish."

"The destructive minxes! But where are you going, dear? Over to
the hospital? Oh! they don't admit visitors on Sunday. Even on
week-days you can't get in till after the surgeons have gone their
rounds, and that is never before ten o'clock. It is military rule, you
know; as regular as clock-work. It won't come ten till sixty minutes
after nine o'clock, not if you perish. The first time I went in there,
the soldier on guard came near running me through with his
bayonet, just because I didn't walk in a certain particular road. I
tried to reason with him; but you might as well reason with stocks
and stones. There was the man in the middle of the road, and
there was the point of his bayonet within an inch of my stomacher;
and the upshot of the matter was, that I had to turn about and
walk in a straight road instead of a curved one, for no earthly
reason that I could see. You really cannot get in to-day. Wait till to-
morrow, and I will go over with you."

Margaret smoothed on her gloves.

"Mrs. Black," she said, "did you ever hear of the man who said that
whenever he saw 'Positively no admittance' posted up anywhere, he
always went in there directly?"

"Well," the lady sighed, "I can't say but you may get in. You are
your grandfather's granddaughter, and he never said fail. Only, be
sure you look your best. You remember the song your mother used
to sing about the chief who offered a boatman a silver pound to
row him and his bride across the stormy ferry; and the Highland
laddie said he would, not for the 'siller bright,' but for the 'winsome
lady.' Many's the time I cried to hear your poor mother sing that,
and how they all perished in the storm, and the father they were
running away from stood on the shore lamenting. Your grandfather
would wipe his eyes on the sly, and wait till she had finished every
word of it; and then he would speak up and say that she had
better be singing the praises of God. May be the officers over there
will be like the Highland boatman, and do for you what they would
n't do for an ugly old woman like me."

Margaret closed her ears to that piercing sentence, "the song your
mother used to sing "—O silent lips!—and going out, crossed over
to the hospital.

As she turned into a curved road that approached the door, a


soldier pacing there presented his bayonet, probably the same one
that had threatened Mrs. Black's plaited linen stomacher.

"You must go the other way," he said with military brevity.

The smaller the warrior, the greater the martinet. Doubtless this
young man regarded his present adversary with far more fierceness
than he would have shown toward a six-foot Texan grey coat, with
a belt bristling with armor, and two eyes like two blades.

Margaret retreated with precipitance, hiding a smile, and took the


other road.

"Your pass, ma'am," said a second soldier at the step.

"I haven't any," she said pitifully, and looked with appealing eyes at
an officer just inside the door.

He came out immediately.

"What is your pleasure, madam?" he asked, touching his hat.

She told her errand briefly, and handed him the letters she had
brought.

Mrs. Black had not overrated the power of the winsome lady. The
surgeon in charge, for this was he, merely glanced over the letters
to learn the bearer's name and State. He had already found her
face, voice, and gloves such as should, in his opinion, be admitted
anywhere and at all times.

"Please come in," he said courteously. "It is almost inspection time


now, and I must be on duty. But if you will wait in my office a little
while, I shall be happy to escort you through the wards."

"Thank you! But cannot I go now, by myself?" said Margaret.

He drew himself up stiffly, in high dudgeon at the little value she


set on his escort. "Certainly! You can do just as you please."

She thanked him again, and went up the hall, utterly unconscious
that she had been greatly honored.

The hall was very long, so long that the door at the furthest end
looked as though only a child could go through without stooping,
and the wards were built out to right and left. She visited every
one, walking up and down the rows of beds, her eager glance
flashing from face to face. There was no face there that she had
ever seen before. With a faint voice she asked for the names of
those who had lately died. The names were as strange as the
faces. Finally she sat down in one of the wards to rest.

The inside of the hospital was altogether less gloomy than the
outside had appeared. They were in a bustle of preparation for
inspection, putting clean white covers on the beds and the stands,
regulating the medicine-table and the book-shelves, squaring
everything, looking out that the convalescents were in trim, belt-
buckles polished, shoes bright, hair smooth, jackets buttoned up to
the chin.

The ward looked fresh and cheerful. The white walls were
festooned with evergreen, green curtains shaded the windows, and
the floor was as white as a daily scouring could make it. Nearly half
of the patients were dressed, and eagerly talking over the news;
and even the sickest there looked on with interest, and brightened
occasionally.

"Fly round here!" cried the ward-master, a fair-faced, laughing


young German. "They've gone into the next ward. Hustle those
clothes out of sight somewhere. Tumble 'em out the window! Kohl,
if you groan while the surgeons are here, I'll give you nothing but
quinine for a week. Can't somebody see to that crazy fellow up
there! He's pulling the wreath down off the wall. Pitch into him! Tell
him that he shan't have a bit of ice to-day if he doesn't lie still. And
there's that other light-head eating the pills all up. I'll be hanged if
he hasn't swallowed twenty-five copper and opium pills! Well, sir,
you're dished. Long Tom, mind yourself, and keep your feet in
bed."

"I can't!" whispered Tom, who seemed to be a mere boy, though


his length was something preposterous. "The bed is too short."

"Well, crumple up some way," said the ward-master, laughing. "I'll


have you up next week, fever or no fever. If you lie there much
longer, you'll grow through the other side of the ward."

"It isn't my fault," Tom said pitifully to Miss Hamilton, who sat near
him. "When I went to bed here, five weeks ago, I wasn't any taller
than the ward-master; and now I believe I'm seven feet long. I
believe it was that everlasting quinine!" And poor Tom burst into
tears.

"Here they are!" said the ward-master. "Attention!"

Instantly all was silence. Each convalescent stood at the foot of his
bed, and the nurses were drawn up inside the door. The little
procession of surgeons appeared, marched up one side of the ward
and down the other, and out the door; and the inspection was over.

As they passed by her, one of them, in drawing his handkerchief


from his pocket, drew with it a card, which, unseen by him,
dropped at Margaret's feet. She took it up, and saw the photograph
of the gentleman who had dropped it, dressed in the uniform of a
Confederate colonel.

"Who was that last surgeon in the line?" she asked of Tom.

"That's our surgeon, Doctor A——. He is a Virginian."

"Who is his guarantee here, do you know?" she inquired.

"He's a friend of Senator Wyly's," Tom said.

An orderly came to the door. "Every man who is able to carry a rifle
get ready to go down to Camp Distribution," he said. "Don't let any
of 'em shirk, Linn. Send some of those fellows down to the office to
be examined. Every man is wanted."

As Margaret went out, she saw Surgeon A—— hasten from one of
the wards, and look along the floor of the hall, as if in search of
something. His face was very pale, she saw, and he looked up
sharply at her as she approached him.

"Perhaps you miss this photograph, Col. A——," she said, offering it
to him.

His face reddened violently as he took it. "Has any one seen it
besides you, madam?" he asked.

"No one."

"Will you give me an opportunity to explain?" he asked eagerly. "If


you would permit me to call on you, or accompany you out now—"

"By no means," she replied coldly. "I do not wish to hear any
explanation. I am here on business of my own, and shall not,
probably, take any further notice of what I have seen. But if on
second thought I should consider myself obliged to mention it, you
can make your explanation to Mr. Lincoln."

She left him at that, and went home to hear Mrs. Black's
compliments on her success.

There were no more visits that day; but the next morning a close
carriage was sent to the door, and Margaret began her rounds.

In the afternoon she found herself going out Fourteenth street


toward Columbia Hospital. There was a shower, and as the horses
plodded along through the pouring floods of southern rain, she
leaned her face upon her hand and wondered sadly what was to
come of this search of hers, and if that strange, irresistible impulse
on which she had been shot, like Camilla on her spear, over every
obstacle to her coming, had been, after all, but a vain whim.

Looking up presently, she found that they were in the midst of


what seemed to her an army, soldiers crowding close to the
carriage, and stretching forward and backward as far as she could
see. It was the Sixth corps, one of them told her, going out to
meet Early and Breckinridge.

They were marching in a mob, without order, plodding wearily


through the rain that just served to wash from them the stains of
their last battle. Their faces were browned and sober, their clothes
faded and stained; many, foot-sore with long marches, carried their
shoes in their hands. They were little enough like the gay troops
she had seen march away from home.

When they came to the college hospital, it was found impossible to


reach the side-walk through that crowd, and Margaret ordered the
driver to wait till they should pass. As she leaned back in her
carriage and watched the living stream flow slowly over the hill, a
gentleman came out of the hospital, and, standing on the sidewalk
opposite her, seemed to be looking for some one among them.
Presently his face brightened with a recognizing smile, and he
waved his handkerchief to one who was riding near. As the
horseman drew up between her and the sidewalk, Margaret's heart
seemed to leap into her mouth. He was wrapped in a cloak, and a
wide-brimmed hat, still dripping from the spent shower, shaded his
face; but she knew him at the first glance.

"O Mr. Granger!"

A shout from the convalescents collected outside the tent wards


drowned her glad cry, and the next instant she would not for the
world have repeated it. By a sudden revulsion of feeling, the face
that had flushed with delight now burned with unutterable shame
and humiliation.

For the first time she looked on what she had done as the world
might look upon it—as Mr. Granger himself might look upon it.
Friends or foes, he was a gentleman, and she a lady, and not a
baby. She, wandering from place to place, unbidden, in search of
him, weeping, praying, making a fool of herself, she thought
bitterly, and he sitting his horse there gallantly, safe and merry,
within reach of her hand, showing his white teeth in a laugh,
stroking down his beard with that gesture she knew so well, taking
off his hat to shake the raindrops from it, and loop up the aigrette
at the side!

She had time to remember with a pang of envy the quiet, guarded
women who sit at home, and take no step without first thinking
what the world will say of it.

"If he should think of me at all," she said to herself, "he would


fancy me at home, trailing my dress over his carpets, making little
strokes with a paint-brush, having a care lest I ink my fingers, or
teaching Dora to spell propriety—as I ought to be! as I ought to
be! I need a keeper!"

But still, with her veil drawn close, she looked at him steadily; for,
after all, he was going into battle, and he was her friend. As she
looked, he glanced up at one of the hospital windows, and
immediately his glance became an earnest gaze. He ceased
speaking, and his face showed surprise and perplexity.

"What do you see?" his friend asked.

"Strange!" he muttered, half to himself. "It is only a resemblance,


of course, but I fancied I saw there a face I know, looking out at
me. It is gone now."

Whatever it was, the sight appeared to sober as well as perplex


him. He took leave of his friend, and, drawing back to join his
regiment, brought his horse round rather roughly against Miss
Hamilton's carriage.

"I beg your pardon, madam!" he said at once, taking off his hat to
the veiled lady he saw there.

He must have thought her scarcely courteous; for she merely


nodded, and immediately turned her face away.

He rode slowly on, looking back once more to the hospital window,
and in a few minutes was out of sight.

"Will you get out now?" asked the driver.

Margaret started.

"Why, yes."

She went in and seated herself in the hall. "I want to rest," she
said to a soldier who stood there. "I don't feel quite well."

A slight, elderly lady in a black dress, and with her bonnet a little
awry, came down the stairs, and stood looking about as though she
expected some one.
"Can you tell me where Miss Blank is to be found?" she asked of
the soldier to whom Margaret had spoken. "She has been out in
the tent wards, and there she comes," he said, nodding toward a
young woman who came in at the door furthest from them, and,
with a face expressive of apprehension, approached the waiting
lady.

"You wished to see me?" she asked tremulously.

"Yes," was the reply. "You will be ready to return home to-morrow,
or as soon as communication is reestablished. I will send your
transportation papers to-night. You need not go into the wards
again."

The young woman stared in speechless distress and astonishment,


her eyes filling with tears.

"Is that Miss Dix?" Margaret asked of the soldier.

"Yes," he replied. "She makes short work of it. That is one of the
best nurses, and the best dresser in the hospital."

"Why is she dismissed?"

"Miss Dix has probably heard something about her. She's a good
young woman, but the old lady is mighty particular."

Margaret rose to meet Miss Dix as she came along the hall.

"I am going to stay in Washington a few days," she said, "and I


would like to be useful while I am here. Can I do anything for
you?"

"Who are you?" asked the lady. Margaret presented her credentials,
and Miss Dix glanced them over, then looked sharply at their owner.

"I am afraid you are too young," she said.


"I am twenty-eight, and I feel a hundred," said Margaret.

"Do you know anything about nursing?"

"As much as ladies usually know."

"Will you go to a disagreeable place?"

"Yes, if it is not out of the city."

"Come, then; my ambulance is at the door."

In two minutes the carriage was dismissed, and Margaret was


seated in the ambulance, and on her way down to the city again.

"You will be very careful who you speak to," the lady began; "you
will dress in the plainest possible manner, wear no ornaments, and,
of course, high necks and long sleeves. Your hair—are those waves
natural?"

"Yes'm!" said Margaret humbly, and was about to add that perhaps
she could straighten them out, but checked herself.

"Well, dress your hair very snugly, wear clean collars, and don't let
your clothes drag. It looks untidy. Is that dress quite plain?"

Margaret threw back the thin mantle she wore, and showed a gray
dress of nunlike plainness.

"That will do," the lady said approvingly.

Here they turned into the square, and got out at the door of the
hospital Margaret had visited the day before. She was introduced to
the officer of the day, received an astonished bow from the
surgeon-in-charge in passing, caught a glimpse of Doctor A——,
and was escorted to her ward.

"Be you the new lady nurse?" asked Long Tom.


"So it seems; but I am not quite sure," she said.

"I'm proper glad," said Tom, with an ecstatic grin. "I liked the looks
of you when I saw you yesterday."

"And so here I am 'at the court of the king,'" she thought.

Chapter XIV.

Out Of Harm's Way.

Common sense goes a great way in nursing; and when there is


added a sympathetic heart, steady nerves, a soft voice, and a
gentle hand, your nurse is about perfect, though she may not have
gone through a regular course of training.

Ward six considered itself highly favored in having Miss Hamilton's


ministrations, even for a few days. The nauseous doses she offered
were swallowed without a murmur, fevered eyes followed her light,
swift step, and men took pride in showing how well they could bear
pain when such appreciative eyes were looking on.

Mrs. Black, rushing over to expostulate and entreat, became a


convert. It was certainly very romantic, she said; and since her
young friend was not treated like a common nurse, but had
everything her own way, it was not so bad. And without, perhaps,
having ever heard the name of Rochefoucauld, the good lady
added, "Anything may happen in Washington now."

Moreover, Miss Hamilton would sleep and take her meals at Mrs.
Black's, which was another palliating circumstance.
Mr. Lewis, with a fund of gibes ready, came also to see the new
nurse. But the sight of her silenced him.

Bending over a dying man to catch the last whisper of a message


to those he would never see again; speaking a word of
encouragement to one who lay with his teeth clenched and with
drops of agony standing on his forehead; mediating in the chronic
quarrel between regulars and volunteers; hushing the ward, that
the saving sleep of an almost exhausted patient might not be
broken—in each of these she seemed in her true place. As he
looked on, he began to realize how impertinent are
conventionalities when life and death are in the balance.

"I don't blame you, Margaret," he said seriously, "though I am glad


that you don't think of staying any longer than I do. I will give you
till Friday afternoon. If we start then, we can reach home by
Sunday morning. The track is open, and I am just off for Baltimore.
Good-by."

She accompanied him to the door. "If you should see Mr. Granger,
or write to him," she said, with some confusion, "don't mention
why I came here. I am ashamed of it."

"Oh! you needn't feel so," he replied soothingly. "We have had a
nice little adventure to pay us for the journey; and you were
breaking your heart with inaction and anxiety."

"Women should break their hearts at home!" she said proudly, her
cheeks glowing scarlet.

That was Wednesday. Thursday morning, as she rose from a five


o'clock breakfast to go over to the hospital, a carriage stopped at
the door, and, looking out, she saw Mr. Lewis coming up the walk.

O God! The blow had fallen! No need even to look into his white
and smileless face to know that.
He stopped, and spoke through the open window. "Come,
Margaret!"

Morning, was it? Morning! She could hardly see to reach the
carriage, and the earth seemed to be heaving under her feet.

As they drove through that strange, feverish world that the sunny
summer day had all at once turned into, she heard a long, heavy
breath that was almost a groan. "O dear!" said Mr. Lewis.

She reached out her hand to him, as one reaches out in the dark
for support. "Tell me!"

"It is a wound in the head," he said; "and any wound there is bad.
I got the dispatch at Baltimore last night, and came right back.
They forwarded it from Boston. Why did not you tell me that you
saw him Monday?"

"Saw him!"

"Then you didn't know him?" Mr. Lewis said. "I thought it strange
you shouldn't mention it. Louis says that when they were going out
past Columbia College, he glanced up at one of the windows, and
saw you leaning out and looking at him. You were very sober, and
made no motion to speak; and after a moment your face seemed
to fade away. It made such an impression on him that he asked to
be carried there and to that room, though it isn't an officers'
hospital. He was almost superstitious about it, till I told him that
you were really here."

It was true then. The intensity of her gaze, and the concentration
of her thoughts upon him at that moment had by some mystery of
nature which we cannot explain, though guesses have been many,
impressed her image on his mind, and thrown the reflection of it
through his eyes, so that where his glance chanced to fall at that
instant, there she had seemed to be.
"You must try to control yourself, Margie," Mr. Lewis went on, his
own lip trembling. "There is danger of delirium. He is afraid of it,
and watches every word he says. He can't talk much. I'll give you a
chance to say all you want to; and whenever I'm needed, you can
call me. I will wait just outside the door. Give your bonnet and
shawl to the lady. There, this is his room, and that is yours, just
across the entry."

Then they went in.

The pleasant chamber was clean, cool, and full of a soft flicker of
light and shade from trees and vines outside. On a narrow, white
bed opposite the windows lay Mr. Granger. Could it be that he was
ill? His eyes were bright, and his face flushed as if with health. The
only sign of hurt was a little square of wet cloth that lay on the top
of his head. But in health, in anything short of deadly peril, he
would have smiled on seeing her after so long a time, and when
she stood in such need of reassuring. His only welcome was an
outstretched hand, and a fixed, earnest gaze.

She seated herself by the bedside. "I have come to help take care
of you, Mr. Granger." Then smiling, faintly, "You don't look very
sick."

"I was in high health before I got this," he said, motioning toward
his head.

Perhaps he saw in her face some sharp springing of hope; for he


closed his eyes, and added almost in a whisper, "It isn't as wide as
a barn-door, nor as deep as a well; but it will do."

The room swam round before her eyes a moment, but she kept her
seat.

Presently the surgeon came in, and she gave place to him. But as
he removed the cloth from his patient's head, she bent
involuntarily, with the fascination of terror, and looked, and at the
sight, dropped back into her chair again. She had looked upon
nature in her inmost mysterious workshop, to which only death can
open the door. It was almost like having committed a sacrilege.

Mr. Lewis wet a handkerchief with cologne, and put it into her
hand. The others had not noticed her agitation.

When the surgeon left the room, he beckoned Margaret out with
him. "All that you can do is, to keep his head cool," he said. "Don't
let him get excited, or talk much without resting. He has kept
wonderfully calm so far; but it is by pure force of will. I never saw
more resolution."

There was nothing to do, then, but to sit and wait; to make him
feel that he was surrounded by loving care, and to let no sign of
grief disturb his quiet.

She returned to the room, and Mr. Lewis, after bending to hold the
sick man's hand one moment in a silent clasp, went out and left
them together.

After a little while, when she had resumed her seat by him, Mr.
Granger spoke, always in that suppressed voice that told what a
strain there was on every nerve. "I should have asked you to marry
me, Margaret, if I had gone back safe," he said, looking at her with
a wistful, troubled gaze, as if he wished to say more, but could not
trust himself.

"No matter about that now," she replied gently. "You have been a
good friend to me, and that is all I ever wanted."

"We could be married here, if you are willing," he went on. "Mr.
Lewis will see to everything."

Margaret lightly smoothed his feverish hands. "No," she said, "I do
not wish it. I didn't come for that. We are friends; no more. Let me
wet the cloth on your head now. It is nearly dry."
He closed his eyes, and made no answer. If he guessed confusedly
that his proposal, and what it implied, so made, was little less than
an insult, it was out of his power to help it then. And if for a breath
Margaret felt that all her obligations to him were cancelled, and
that she could not even call him friend again, it was but for a
breath. His case was too pitiful for anger. She could forgive him
anything now.

"I shall always stay with Dora, if you wish it," she said softly. "Do
not have any fears for her. I will be faithful. Trust me. I could
gladly do it for her sake, for I never loved any other child so much.
But still more, I will take care of her for yours."

"I arranged everything before I came away," he said, looking up


again. And his eyes, she saw, were swimming in tears. "I looked
out for both of you. Your home was to be always with her, and Mr.
Lewis to be guardian for both."

Margaret could not trust herself to thank him for this proof of his
care for her.

"Have you seen the chaplain?" she asked, to turn the subject.

"Yes; but I don't feel like seeing him again. He does me no good,
and his voice confuses me. You are all the minister I need"—smiling
faintly—"and yours is the only voice I can bear."

While he rested, she sat and studied how indeed she should
minister to him.

Mr. Granger had never been baptized; and, though nominally what
is called an orthodox Congregationalist, he held their doctrines but
loosely. He had that abstract religious feeling which is the heritage
of all noble natures, the outlines of Christianity even before
Christianity is adopted, as Madame Swetchine says; but his
experience of pietists had not been such as to tempt him to join
their number. If a man lived a moral life, were kind, just, and pure,
it was about all that could be required of him, he thought. Such a
life he had lived; and now, though he approached death solemnly,
it was with no perceptible tremor, and no painful sense of
contrition.

She watched him as he lay there, smitten down in the midst of his
life and of health. He was quiet, now, except that his hands never
ceased moving, tearing slowly in strips the delicate handkerchief he
found within his reach, pulling shreds from the palm-leaf fan that
lay on the bed, or picking at the blanket. It was the only sign of
agitation he showed. His face was deeply flushed, his breathing
heavy, and his teeth seemed to be set.

Once he raised himself, and looked through the open window at


the treetops, and the city spires and domes. Margaret wondered if
they looked strange to him, and what thoughts he had; but she
never knew.

After waiting as long as she dared, she spoke to him. "Can I talk to
you a little, Mr. Granger, without disturbing you?" she asked.

"Speak," he said; "you never disturb me."

She began, and without any useless words, explained to him the
fundamental doctrines of the church, original sin, the redemption,
the necessity and effects of baptism. What she said was clear,
simple, and condensed. A hundred times during the last two years
she had studied it over for just such need as this.

"You know of course," she concluded, "that I say this because I


want you to be baptized. Are you willing?"

"I would like to do anything that would satisfy you," he said


presently. "But you would not wish me to be a hypocrite? You
cannot think that baptism would benefit me, if I received it only
because you wanted me to. I don't think that I have led a bad life.
I have not knowingly wronged any one. I am sorry for those sins
which, through human frailty, I have committed. But if I were to
live my life over again, I doubt if I should do any better. No, child, I
think it would be a mockery for me to be baptized now."

She changed the cloth on his head, laid the ice close to his burning
temples, and fanned him in silence a few minutes.

Then she began again, repeating gently the command of our


Saviour regarding baptism, and his charge to the church to baptize
and teach.

"It is impossible to force conviction," he said. "I cannot profess to


believe what I do not."

The words came with difficulty, and his brows contracted as if some
sudden pain shot through them.

"I am not careless of the future, dear," he said after a while. "I
know that it is awful, and uncertain; but it is also inevitable! It is
too late now for me to change. But I wish that you would pray for
me. Let me hear you. Pray your own way. I am not afraid of your
saints."

Margaret knelt beside the bed, and repeated the Our Father. He
listened reverently, and echoed the Amen. She repeated the Acts,
and there was no response this time; the Creed, and still there was
no answer. She could not rise. In faltering tones she said the
Memorare, with the request, "Obtain for this friend of mine the gift
of faith, that though lost to me he may not be lost to himself."

Still he was silent. All the pent emotion of her soul was surging up,
and showing the joints in her mail of calmness. He was going out
into what was to him the great unknown, and she, with full
knowledge of the way, could not make him see it. One last, vain
effort of self-control, then she burst forth with a prayer half
drowned in tears.
"O merciful Christ! I cannot live upon the earth unless I know that
he is in heaven. Thou hast said, Knock, and it shall be opened unto
you. With my heart and my voice I knock at the door. Open to me
for thy word's sake! Thou hast said that whatever we ask in thy
name, we shall receive. I ask for faith, for heaven, for my friend
who is dying. Give them for thy word's sake! Thou hast said that
whoever does good to the least of thy children has done it unto
thee. Remember what this man has done for me. I was miserable,
and he comforted me. I was at the point of death, and he saved
me. I was hungry, and he fed me. I was a stranger, and he took
me in. Oh! look with pity on me, who in all my life have had only
one year of happiness, but many full of sorrow; see how my heart
is breaking, and hear me for thy word's sake! for thy word's sake!"

As her voice failed, a hand touched her head, and she heard Mr.
Granger's voice.

"I cannot make you distrust the truth of God," he said. "I do not
believe; but also, I do not know. I am willing to do all that he
requires. Perhaps he does require this. Such faith as yours must
mean something. Do as you will."

"May I send for a priest right away? And will you be baptized?"

"Dear little friend, yes!" he said.

"O Mr. Granger! God bless you! I am happy. Doesn't he keep his
promises? I will never distrust him again."

His grave looks did not dampen her joy. Of course it was not
necessary that he should have much feeling. The good intention
was enough. She wet his face with ice-water, laid ice to his head,
put the fan in his hand, in her childish, joyful way, shutting his
fingers about it one by one, then went out to send Mr. Lewis for a
priest.
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!

ebookmass.com

You might also like