SlideShare a Scribd company logo
C programming from problem analysis to program
design 4th ed Edition D S Malik download
https://ebookultra.com/download/c-programming-from-problem-
analysis-to-program-design-4th-ed-edition-d-s-malik/
Explore and download more ebooks or textbooks
at ebookultra.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.
Java TM Programming From Problem Analysis to Program
Design 5th Edition D. S. Malik
https://ebookultra.com/download/java-tm-programming-from-problem-
analysis-to-program-design-5th-edition-d-s-malik/
Problem Solving and Program Design in C Third Edition Jeri
R. Hanly
https://ebookultra.com/download/problem-solving-and-program-design-in-
c-third-edition-jeri-r-hanly/
Introduction to Numerical Analysis 2nd Edition D. C.
Sanyal
https://ebookultra.com/download/introduction-to-numerical-
analysis-2nd-edition-d-c-sanyal/
Visual C 2010 How to Program 4th Edition 1 29 pdf Paul
Deitel
https://ebookultra.com/download/visual-c-2010-how-to-program-4th-
edition-1-29-pdf-paul-deitel/
Analysis and Design of Analog Integrated Circuits 4th ed
Edition Paul R. Gray
https://ebookultra.com/download/analysis-and-design-of-analog-
integrated-circuits-4th-ed-edition-paul-r-gray/
Programming and Problem Solving with C Comprehensive
Comprehensive Edition Nell B. Dale
https://ebookultra.com/download/programming-and-problem-solving-with-
c-comprehensive-comprehensive-edition-nell-b-dale/
C how to program Tenth Edition Deitel
https://ebookultra.com/download/c-how-to-program-tenth-edition-deitel/
Programming C 2nd ed Edition Jesse Liberty
https://ebookultra.com/download/programming-c-2nd-ed-edition-jesse-
liberty/
C Programming in Linux 1st edition Edition Haskins D.
https://ebookultra.com/download/c-programming-in-linux-1st-edition-
edition-haskins-d/
C programming from problem analysis to program design 4th ed Edition D  S Malik
C programming from problem analysis to program
design 4th ed Edition D S Malik Digital Instant Download
Author(s): D S Malik
ISBN(s): 9781423902096, 1423902092
Edition: 4th ed
File Details: PDF, 11.47 MB
Year: 2009
Language: english
C++ PROGRAMMING:
FROM PROBLEM ANALYSIS TO PROGRAM DESIGN
FOURTH EDITION
D.S. MALIK
Australia  Brazil  Japan  Korea  Mexico  Singapore  Spain  United Kingdom  United States
C++ Programming: From Problem Analysis
to Program Design, Fourth Edition
by D.S. Malik
Senior Product Manager: Alyssa Pratt
Acquisitions Editor: Amy Jollymore
Content Product Manager: Jill Braiewa
Marketing Manager: Bryant Chrzan
Editorial Assistant: Patrick Frank
Print Buyer: Julio Esperas
Cover Designer: Lisa Kuhn, Curio Press, LLC
Compositor: Integra
Art Director: Marissa Falco
Validation: Green Pen Quality Assurance
Proofreader: Green Pen Quality Assurance
Indexer: Liz Cunningham
Printed in Canada
1 2 3 4 5 6 7 14 13 12 11 10 09 08
ª 2009 Course Technology, Cengage Learning
ALL RIGHTS RESERVED. No part of this work covered by the
copyright herein may be reproduced, transmitted, stored or used
in any form or by any means graphic, electronic, or mechanical,
including but not limited to photocopying, recording, scanning,
digitizing, taping, Web distribution, information networks, or
information storage and retrieval systems, except as permitted
under Section 107 or 108 of the 1976 United States Copyright Act,
without the prior written permission of the publisher.
For product information and technology assistance, contact us at
Cengage Learning Customer  Sales Support, 1-800-354-9706
For permission to use material from this text or product, submit
all requests online at cengage.com/permissions
Further permissions questions can be emailed to
permissionrequest@cengage.com
ISBN-13: 978-1-4239-0209-6
ISBN-10: 1-4239-0209-2
Course Technology
25 Thomson Place
Boston, MA 02210
USA
Visual
C++ .NET and PowerPoint
are registered trademarks
of the Microsoft Corporation; Pentium
is a registered
trademark of Intel Corporation; IBM is a registered trademark
of Industrial Business Machines.
Disclaimer
Course Technology reserves the right to revise this publication
and make changes from time to time in its content without
notice.
The programs in this book are for instructional purposes only.
They have been tested with care, but are not guaranteed for any
particular intent beyond educational purposes. The authors and
the publisher do not offer any warranties or representations, nor
do they accept any liabilities with respect to the programs.
Cengage Learning is a leading provider of customized
learning solutions with office locations around the globe,
including Singapore, the United Kingdom, Australia, Mexico,
Brazil, and Japan. Locate your local office at:
international.cengage.com/region
Cengage Learning products are represented in Canada
by Nelson Education, Ltd.
For your lifelong learning solutions, visit
course.cengage.com
Visit our corporate website at cengage.com
TO
My Daughter
Shelly Malik
C programming from problem analysis to program design 4th ed Edition D  S Malik
PREFACE xxvii
1. An Overview of Computers and Programming Languages 1
2. Basic Elements of C++ 29
3. Input/Output 115
4. Control Structures I (Selection) 167
5. Control Structures II (Repetition) 231
6. User-Defined Functions I 307
7. User-Defined Functions II 345
8. User-Defined Simple Data Types, Namespaces,
and the string Type 415
9. Arrays and Strings 469
10. Applications of Arrays (Searching and Sorting)
and the vector Type 545
11. Records (structs) 603
12. Classes and Data Abstraction 641
13. Inheritance and Composition 717
14. Pointers, Classes, Virtual Functions, and Abstract Classes 785
15. Overloading and Templates 853
16. Exception Handling 943
17. Recursion 981
18. Linked Lists 1017
19. Stacks and Queues 1111
BRIEF CONTENTS
APPENDIX A Reserved Words 1219
APPENDIX B Operator Precedence 1221
APPENDIX C Character Sets 1223
APPENDIX D Operator Overloading 1227
APPENDIX E Additional C++ Topics 1229
APPENDIX F Header Files 1251
APPENDIX G Memory Size on a System and Random
Number Generator 1261
APPENDIX H Standard Template Library (STL) 1263
APPENDIX I Answers to Odd-Numbered Exercises 1305
INDEX 1327
vi | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
Preface xxvii
AN OVERVIEW OF COMPUTERS
AND PROGRAMMING LANGUAGES 1
Introduction 2
A Brief Overview of the History of Computers 2
Elements of a Computer System 3
Hardware 4
Central Processing Unit 4
Main Memory 5
Secondary Storage 6
Input /Output Devices 6
Software 6
The Language of a Computer 6
The Evolution of Programming Languages 8
A C++ Program 10
Processing a C++ Program 12
Programming with the Problem
Analysis–Coding–Execution Cycle 14
Programming Methodologies 22
Structured Programming 22
Object-Oriented Programming 22
ANSI/ISO Standard C++ 24
Quick Review 24
Exercises 26
1
TABLE OF CONTENTS
BASIC ELEMENTS OF C++ 29
The Basics of a C++ Program 30
Comments 32
Special Symbols 32
Reserved Words (Keywords) 33
Identifiers 33
Whitespaces 34
Data Types 34
Simple Data Types 35
Floating-Point Data Types 38
Arithmetic Operators and Operator Precedence 40
Order of Precedence 44
Expressions 45
Mixed Expressions 46
Type Conversion (Casting) 48
string Type 50
Input 51
Allocating Memory with Constants and Variables 52
Putting Data into Variables 54
Assignment Statement 54
Saving and Using the Value of an Expression 58
Declaring and Initializing Variables 59
Input (Read) Statement 60
Variable Initialization 63
Increment and Decrement Operators 67
Output 69
Preprocessor Directives 77
namespace and Using cin and cout in a Program 78
Using the string Data Type in a Program 78
Creating a C++ Program 79
Program Style and Form 83
Syntax 83
2
Use of Blanks 84
viii | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
Use of Semicolons, Brackets, and Commas 84
Semantics 84
Naming Identifiers 84
Prompt Lines 85
Documentation 86
Form and Style 86
More on Assignment Statements 88
Programming Example: Convert Length 99
Programming Example: Make Change 93
Quick Review 97
Exercises 99
Programming Exercises 107
INPUT/OUTPUT 115
I/O Streams and Standard I/O Devices 116
cin and the Extraction Operator  117
Using Predefined Functions in a Program 123
cin and the get Function 125
cin and the ignore Function 126
The putback and peek Functions 128
The Dot Notation Between I/O Stream Variables
and I/O Functions: A Precaution 130
Input Failure 131
The clear Function 133
Output and Formatting Output 135
setprecision Manipulator 135
fixed Manipulator 136
showpoint Manipulator 136
setw 138
Additional Output Formatting Tools 141
setfill Manipulator 141
left and right Manipulators 143
3
Input/Output and the string Type 145
Table of Contents | ix
File Input/Output 146
Programming Example: Movie Ticket Sale and
Donation to Charity 150
Programming Example: Student Grade 155
Quick Review 158
Exercises 160
Programming Exercises 163
CONTROL STRUCTURES I (SELECTION) 167
Control Structures 168
Relational Operators 169
Relational Operators and Simple Data Types 171
Comparing Floating-point Numbers for equality 171
Comparing Characters 172
Relational Operators and the string Type 173
Logical (Boolean) Operators and Logical Expressions 175
Order of Precedence 177
Short-Circuit Evaluation 181
int Data Type and Logical (Boolean) Expressions 182
bool Data Type and Logical (Boolean) Expressions 183
Selection: if and if...else 184
One-Way Selection 185
Two-Way Selection 187
Compound (Block of) Statements 191
Multiple Selections: Nested if 192
Comparing if...else Statements with
a Series of if Statements 196
Using Pseudocode to Develop, Test, and Debug a Program 196
Input Failure and the if Statement 199
Confusion Between the Equality Operator (==) and
the Assignment Operator (=) 202
Conditional Operator (?:) 203
4
switch Structures 204
x | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
Terminating a Program with the
assert Function 211
Programming Example: Cable Company Billing 213
Quick Review 219
Exercises 220
Programming Exercises 225
CONTROL STRUCTURES II (REPETITION) 231
Why Is Repetition Needed? 232
while Looping (Repetition) Structure 233
Designing while loops 235
Case 1: Counter-Controlled while Loops 236
Case 2: Sentinel-Controlled while Loops 239
Case 3: Flag-Controlled while Loops 243
Case 4: EOF-Controlled while Loops 247
eof Function 248
More on Expressions in while Statements 249
Programming Example: Checking
Account Balance 250
Programming Example: Fibonacci Number 259
for Looping (Repetition) Structure 264
Programming Example: Classifying Numbers 270
do...while Looping (Repetition) Structure 274
Choosing the Right Looping Structure 278
break and continue Statements 278
Nested Control Structures 281
Quick Review 288
Exercises 290
Programming Exercises 300
5
Table of Contents | xi
USER-DEFINED FUNCTIONS I 307
Predefined Functions 308
User-Defined Functions 311
Value-Returning Functions 312
Syntax: Value-Returning Functions 314
Syntax: Formal Parameter List 314
Function Call 314
Syntax: Actual Parameter List 314
return Statement 315
Syntax: return Statement 315
Function Prototype 318
Syntax: Function Prototype 319
Flow of Execution 325
Programming Example: Largest Number 326
Programming Example: Cable Company 327
Quick Review 333
Exercises 335
Programming Exercises 340
USER-DEFINED FUNCTIONS II 345
Void Functions 346
Void Functions without Parameters 346
Void Functions with Parameters 349
Value Parameters 354
Reference Variables as Parameters 356
Value and Reference Parameters and Memory Allocation 360
Reference Parameters and Value-Returning Functions 370
Scope of an Identifier 370
Global Variables, Named Constants, and Side Effects 374
Static and Automatic Variables 376
6
7
xii | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
Function Overloading: An Introduction 378
Functions with Default Parameters 380
Programming Example: Classify Numbers 383
Programming Example: Data Comparison 388
Quick Review 398
Exercises 400
Programming Exercises 407
USER-DEFINED SIMPLE DATA TYPES,
NAMESPACES, AND THE string TYPE 415
Enumeration Type 416
Declaring Variables 418
Assignment 418
Operations on Enumeration Types 419
Relational Operators 419
Input /Output of Enumeration Types 420
Functions and Enumeration Types 422
Declaring Variables When Defining the Enumeration Type 424
Anonymous Data Types 424
typedef Statement 425
Programming Example: The Game of Rock, Paper,
and Scissors 426
Namespaces 437
string Type 442
Additional string Operations 446
length Function 446
size Function 448
find Function 449
substr Function 452
swap Function 454
Programming Example: Pig Latin Strings 454
8
Quick Review 460
Table of Contents | xiii
Exercises 463
Programming Exercises 466
ARRAYS AND STRINGS 469
Arrays 471
Accessing Array Components 472
Processing One-Dimensional Arrays 475
Array Index Out of Bounds 479
Array Initialization During Declaration 480
Partial Initialization of Arrays During Declaration 480
Some Restrictions on Array Processing 481
Arrays as Parameters to Functions 482
Constant Arrays as Formal Parameters 483
Base Address of an Array and Array in Computer Memory 485
Functions Cannot Return a Value of the Type Array 488
Integral Data Type and Array Indices 491
Other Ways to Declare Arrays 491
C-strings (Character Arrays) 492
String Comparison 494
Reading and Writing Strings 496
String Input 496
String Output 497
Specifying Input/Output Files at Execution Time 498
string Type and Input/Output Files 498
Parallel Arrays 499
Two- and Multidimensional Arrays 500
Accessing Array Components 502
Two-Dimensional Array Initialization During Declaration 503
Two-Dimensional Arrays and Enumeration Types 503
Initialization 507
Print 507
Input 507
Sum by Row 508
Sum by Column 508
9
xiv | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
Largest Element in Each Row and Each Column 508
Reversing Diagonal 509
Passing Two-Dimensional Arrays as Parameters to Functions 511
Arrays of Strings 514
Arrays of Strings and the string Type 514
Arrays of Strings and C-Strings (Character Arrays) 515
Another Way to Declare a Two-Dimensional Array 516
Multidimensional Arrays 517
Programming Example: Code Detection 518
Programming Example: Text Processing 525
Quick Review 532
Exercises 534
Programming Exercises 539
APPLICATIONS OF ARRAYS (SEARCHING
AND SORTING) AND THE vector TYPE 545
List Processing 546
Searching 546
Bubble Sort 551
Selection Sort 555
Insertion Sort 559
Sequential Search on an Ordered List 566
Binary Search 569
Performance of Binary Search 572
vector Type (class) 574
Programming Example: Election Results 579
Quick Review 595
Exercises 597
Programming Exercises 600
10
Table of Contents | xv
Random documents with unrelated
content Scribd suggests to you:
trees. The whole of this portion is on the site of the former land-slip,
now the richest and most highly-cultivated district of the mountain.
On every side the views were enchanting; Mount Pilatus standing
forth in all his grandeur just opposite, displaying folds and tracts of
pasture-ground we had not attributed to his rugged form. Lost in
admiration, we rode on in comparative silence, until we halted, to
refresh the men and horses, at a café under a splendid tree, and
soon after reached a chapel sheltered by a rock, called in our hand-
book the Heiligenkreuz, or Church of the Holy Cross. “The beginning
of the Stations to Kaltbad,” said my guide, a dark-eyed, refined-
looking man, who had spoken but little hitherto. “Stations to the
Wallfahrtort, or place of pilgrimage at Kaltbad,” he repeated, noticing
my perplexed countenance. “Kaltbad is a Gnadenort, or ‘place of
grace,’ to us, madam,” he continued, “although you perhaps only
know it as a Curort.” And such was the sober truth. I had never
heard it spoken of as anything but a huge hotel with salubrious air.
So now I entered into conversation with my guide, and found that
he constantly made the Stations, in common with all the Weggis
population, up this rugged ascent, until they reach the church at
Kaltbad. “Would I not go to see the church?” he asked. “It was
indeed a Gnadenort. But the feast of the year I could not see, for it
takes place in the middle of May, just before the flocks are sent up
to the summer pastures. Then there is a procession up the
mountain, with the banner we had noticed in the parish church—the
white cross on the red ground.”
So here was the explanation of its place of honor inside the
sanctuary—one more reason why the Weggis folks should hold it
dear and we strangers regard it with reverence. Nay more: should
we not love and cherish a flag which not only symbolizes, but is
practically used by, a modern free people in connection with their
highest and noblest feelings? “In this procession, headed by the
priest,” my informant continued, “we, the people, make the Stations
with hymns and prayers as we go up, and, after first visiting the
Kaltbad church, all ends by the priest blessing the pastures on all
sides before the cattle are permitted to be brought up to them for
the summer season.” The higher we ascended, the steeper became
the road under a straight face of rock, and we could readily fancy
how picturesque, even from an artist's point of view, such a
procession must be, headed by the red flag, winding its way up this
rugged mountain-road; but, combined with the spirit and faith which
animate it, it is impossible to conceive anything more beautiful.
This peasant was a native of Weggis, and soon grew communicative.
“Oh! yes, he had often been to Einsiedeln; every one in that country
had many, many times made the pilgrimage there.” And in fervent
language he described the place to me. He had also been to Tell's
Chapel often, but not yet to Tell's Platform. That was the great
object of his ambition, what he most wished to accomplish, with a
visit to Sachslen to see “Bruder [pg 393] Klaus,” as so many of his
neighbors had done; but another year should not pass without his
carrying out his intentions. Amidst conversation of this kind we
climbed up the straight wall of rock, which seemed to have no issue,
until suddenly we reached a curious group called the Felsenthor,
composed of large fragments fallen from above exactly in the
semblance of a “rocky gate,” as the name implies, and whence the
view is magnificent.
The afternoon was lovely. At each turn one snowy peak after
another had been coming into view. The air, though warm, was
fresher and brisker than at Weggis, while the vegetation had
sensibly changed from the luxuriant chestnuts to the pines and fir-
trees of the Alpine heights. Nothing could be more poetic and
tranquil than our half-hour's repose at this beautiful point, noticing
the approach of sunset-tints on the mountain-wall just opposite
which overhangs Vitznau; watching the pretty steamers looking like
dragon-flies hovering over the lake two thousand feet below; and
then reflecting on the faith and piety of our humble attendants,
which shed a vivifying atmosphere over the whole scene. Our minds
were still full of these thoughts as we set forth again for our last
ascent to Kaltbad, about three-quarters of an hour distant, through a
pretty dell of fallen rocks and fresh verdure. We had quite forgotten
the existence of the railway or its feverish life, when all at once a
turn in the road gave a rude shock to our peaceful meditations.
There were the trains laboring up a barren, steep hill beside us—one
that would be too steep for any horse without three or four zigzag
turns and windings. Three separate trains were coming up at certain
distances in succession, the engines puffing and snorting, panting
and laboring, in the effort to push the one carriage before each, as
though the struggle were too much for their fast-failing strength. It
made one tremble to watch them, and it seemed impossible to
comprehend how the passengers looked so quiet and unconcerned.
How Mrs. C—— and I congratulated ourselves on having kept old-
fashioned ways and despised “progress,” at least for once in our
travels! And when I also thought of the varied charms of our ride,
and all that I had seen of the population and their ways, I felt that
no one who rushes through a country at high-pressure railway speed
can ever hope to understand its people half as well as those who
come into closer contact with them.
Before we had time to recover from the impressions of the railway,
Kaltbad itself appeared in sight, high above our heads, like a green-
jalousied monster of some German watering-place lifted bodily up
from the depths below. Anything more unpoetic than its first view is
not to be found; though it must at once be admitted that first
impressions are not to be trusted in this particular case. It was a
cruel shock, however, to our visions of pious pilgrimages and
processions; a return to the prose of life we had never contemplated
at four thousand four hundred and thirty-nine feet above the level of
the sea.
Our young friends were anxiously awaiting us on the long terrace in
front of the hotel with such sensational accounts of their railway
journey as might well have obliterated all remembrance of the
Wallfahrtort, or “place of pilgrimage,” but for the parting reminder of
my guide, that “the church was behind [pg 394] the house, and he
hoped I would be sure to see it.” But the C——s' only thought now
was of the sunset about to take place, and they hurried us off,
without a moment's delay, to a beautiful spot, called the Käuzli, ten
minutes' distance from the hotel. Certainly no view could be more
glorious! Before us spread half the northern portion of Switzerland—
Mount Pilatus right opposite, Lucerne at our feet, Sempach, the
great lake, just beyond, bathed in a flood of crimson, as though in
harmony with its memories, and bringing back to our minds at one
glance Arnold von Winkelried and all the grand history related to us
so recently by Herr H——. The seven great peaks of the Oberland,
including the Wetterhorn, Monk, and Eiger, towered above the
clouds to our right, while the summits on the south, half facing the
sunset, were lit up by the same kaleidoscopic coloring that we had
witnessed on the first evening of our arrival at Lucerne. Spell-bound
by this fairy-like scene, we lingered here till nearly dark, and it
seemingly became too late to seek out the little church. But young C
—— had discovered it that afternoon, and led me by an intricate
back pathway to its very door. Even at that late hour it was open,
the lamp burning before the altar, and many figures could be
distinguished devoutly praying in the twilight. These, as I afterwards
learned, were servants of the hotel—the laundresses, bath-women,
and porters, who came to pay their visit to the Blessed Sacrament
before retiring to rest after their busy day's work. Mass was
celebrated every morning at half-past seven o'clock, they said. My
own devotions over, I was again led back to the hotel, where the
brilliantly-lighted rooms and crowd of fashionably-dressed ladies—
although the material comforts are by no means to be despised—
were still in harsh discord with our ideas of mountain life.
Next morning, as if we had been in the plain, the church-bell tolled
at the stated hour, and found us ready to sally forth in answer to its
call. In the hotel all was bustle and clatter; but what wonder? Three
hundred guests and upwards have, on an average, to be provided
for daily during the season. In the middle of July four hundred and
twenty were at one time under this roof, but, happily for us, the
numbers had now sensibly decreased. No church, however, was
visible, and it was only on inquiry that I found a pathway in the rear
of the house leading behind two rocks—a true Felsenthor, or “rocky
gate,” they made—hiding away their little treasure. Once past them,
there stood the church, with the sun shining on its roof, small and
simple, but perfect in all its proportions, nestling amongst the
encircling crags and overhanging trees, from amidst which, opposite
the door, trickled a stream of the clearest water. Mass had just
commenced at the centre altar, over which stood a statue of the
Blessed Virgin and Child, surrounded by a garland of flowers, and
two bouquets were laid, evidently as a pious offering, on the two
side altars, which were also adorned by excellent paintings. A
handsome silver lamp hung in the sanctuary, and there was a
confessional, besides benches capable of accommodating a couple of
hundred people, all neatly painted and very clean. To-day the
congregation was small, for the servants could not be spared, we
were told, at that hour from their work, and [pg 395] there were few
Catholic visitors in the house; but we noticed that the clerk rang the
church-bell at the Gospel and the Elevation, so that the shepherds
and others scattered about on the mountain might join their
intention with the priest at the altar. Nothing could exceed the quiet
of the spot. It might have been miles away from the noisy world
hard by, no sound audible but the trickling of the stream outside,
heard through the open door, and enhancing the deep tranquillity of
the scene. A most perfect haven of rest it made for weary souls or
pious pilgrims, and a worthy aim, with the constant presence of the
Blessed Sacrament, for any procession toiling up the precipitous
mountain-side. When Mass was over, we lingered awhile, and,
looking round, a large, illuminated tablet caught our attention. What
was our delight to find it gave the whole history of the place in the
following words:
“Kaltbad on the Rigi.
“Amongst the venerated spots which the goodness of God
seems to have especially chosen for the distribution of rich
spiritual and temporal gifts, Kaltbad on the Rigi has for
centuries enjoyed a well-founded reputation. The natural
operation of the remarkably cold water has in itself given life
and health to thousands. But far more effect has been
produced by trustful prayers, joined with the contrite and
devout reception of the holy sacraments, and aided by the
powerful intercession of the pure Virgin-Mother of God and of
other saints. Remarkable and often perfectly miraculous cures
of countless Christians, in the most different circumstances of
body and soul, have here taken place, which have partly been
recorded in writing, and partly live on in grateful remembrance.
“In former times this place was called the ‘Schwesterborn,’ or
‘Spring of the Sisters’; for the legend relates that in the reign
of the Emperor Albert of Austria—in the beginning of the XIVth
century—three pious sisters retired to this wilderness in order
to escape from powerful governors, or Vogts, and here led
holy and saintly lives. The first miraculous cure on record is
that of a devout Landsassen of Weggis, named Balthasar
Tolen, in the year 1540. From year to year the reputation of
this spring increased. In the year 1585, on the 20th of May,
the first small chapel was consecrated in honor of God, of the
holy Archangel Michael and the other angels, and of the holy
shepherd Wendelin, by Balthasar, Bishop of Ascalon. It proved,
however, insufficient for the number of Alpine inhabitants and
pilgrims. Even after those belonging to the canton Schwytz
built themselves a chapel, a hundred years later, at Mary in the
Snow, or ‘Maria zum Schnee,’ the want of a larger church was
still felt. The present one, with three altars, the middle one of
which possesses the image of the ever Blessed Mother of God,
and the two side ones the pictures of the holy martyr S.
Lawrence and the father of the church, S. Jerome, was built in
the year 1779, and considerably renovated in the year 1861,
when the two new side altars and their paintings by Theodore
von Deschwanden were added.
“On the 20th of July, 1782, His Holiness Pius VI. granted a
plenary indulgence to all the faithful, on any day whatsoever,
on the condition that after approaching the holy sacraments of
Confession and Communion, with contrite and worthy
dispositions, they here devoutly pray for the union of all
Christian princes, the extirpation of heresy, and the increase of
the Holy Catholic Church—an indulgence which can be applied
to the souls in purgatory.
“In order to afford the opportunity of assisting at divine service
on Sundays and holidays to the shepherds as well as to the
pilgrims, and also of approaching the holy sacraments, a
special priest is here appointed during the whole summer
season.”
So here again, even here, the Austrians and imperial Vogts were at
the root of all things—in this instance, however, and unconsciously,
the source of good to many poor sufferers; for numberless ex-votos
filling the end of the little church eloquently told that it had proved
[pg 396] to them a true “place of grace,” as my guide of yesterday
had so beautifully called it. And the little stream outside was the real
“Kaltbad,” whose wonder-working effects had first given the place its
name. Quaint and rude were all the paintings, but full of life and
feeling, mostly from the neighborhood—from Weggis, Vitznau, and
Gersau. Yes, there was a man in a boat in danger on the lake, just
as we had seen from the Gersau hotel two evenings ago; but this
one is praying fervently with clasped hands, and we longed to know
if those who were saved the other day had done likewise.
Then here is a family of boys and girls kneeling in rows, the father
and mother behind, all with their pink, and blue, and green rosaries
twined round their hands, in the selfsame manner that the Gersau
children had theirs during Mass! Above, a child of two years old,
kneeling beside its mother, has a rosary hanging on its arm; quaint
little things in caps like those of their elders, or infants tied on
pillows with quantities of red bows. Red was so much the prevailing
color that it seemed as if it must have some reference to their
beloved national flag. And then there were small waxen hearts, and
ears, and a wooden hand with a fearful gash, the offering, no doubt,
of a grateful wood-cutter. Some of these are upwards of a hundred
or a hundred and fifty years old, with inscriptions in the native
dialect, full of pathos and local color. But most striking of all is a
large painting of the very wall of rock up which we had climbed from
Weggis yesterday, bearing the following simple-worded inscription:
“Be it known to all, that by the breaking up of the dangerous
Rigirocks on the Weggis mountain some of the inhabitants were
threatened with the complete destruction of all their possessions. In
this extremity and distress they turned to heaven, and, with firm
confidence in the gracious Mother of all the angels, they here sought
and found help; for instantly the loosening of the rocks ceased, and
all became quiet again. Therefore, as a perpetual memorial of praise
and thanksgiving to God and the Mother of Mercy, they have
consecrated and hung up this tablet, anno 1753.”
This was clearly forty-two years before the fatal mud-slide which
destroyed so much, and it would be most interesting to know
whether the later victims turned hitherward for succor; but of this no
record exists in the church. In the above painting the Blessed
Mother, holding the divine Infant in her arms, is represented
standing in the centre of the rock-wall, with S. Michael on one side
and S. Lawrence on the other, just as if they had been visible. Had
we only beheld this tablet before, with what different eyes should we
have looked at this face of rock yesterday from the cemetery below,
as also during our ascent! And what proof such a picture and
inscription give of the strong faith of the Weggis population in the
unseen world under whose blessed protection they live in peace and
confidence! Whilst we tarried, peasant after peasant came in. One,
an old woman, took out her rosary, and told her beads leisurely;
another, younger and busier, laid down her basket, prayed for a few
minutes with recollection, and then went on to her work; but what
most struck us was a little girl of about twelve, who also had her
basket, full of fruit and flowers, and had [pg 397] been there before
we arrived for Mass. She waited until we left, and then evidently
thought that we had finally departed. Unexpectedly, however, I
returned to look at the tablet again, and I beheld the little maiden in
the act of dropping some money into the poor box, blushing
modestly when her eyes caught mine. I asked, and found that she
was a Weggis child—one of the number that climb the mountain like
antelopes up to this hotel daily to sell their “fresh figs,” “peaches,”
and “flowers”—for they offer them in good English—the majority of
whom first pay their visit to the Blessed Sacrament in this church,
and leave some little offering for themselves or their parents. She
was a blue-eyed, intelligent girl—one who had made her first
communion two years previously, and approached the Holy
Sacrament manchmal—many times, she said, during the course of
the year.
As time went on, experience taught us that the children of the Rigi
are one of its most distinctive characteristics. Intelligent, bright-
countenanced, and yet modest, they are the most attractive race of
juveniles to be met with in Switzerland, and, as yet, are unspoiled by
contact with the stranger crowd. They form the most remarkable
contrast to those of the Bernese Oberland, where the grandeur of
Grindelwald and other spots is so much marred by the swarms of
sickly beggar-children that there flock round one from all quarters.
Here, on the contrary, they are brimful of health and intelligence,
and never once during all our wanderings in the forest cantons did a
beggar, old or young, ever cross our path. So much for the popular
fallacy, or rather calumny, which says that prosperity, comfort, and
thrift are alone to be found in the Protestant cantons, and that
beggary, want, and uncleanliness mark the entrance into the
Catholic districts. Like many such sayings, it does not bear
investigation; but when even the most just-minded start on their
travels with prejudiced minds, it is astonishing how readily they
accept the opinions of men whose want of observation they despise
at home. Above all, should the question be anything concerning
Catholicity, their wilful blindness surpasses all belief. Some
exceptions to this rule there certainly are, increasing, too, each year,
like the celebrated Dr. Arnold, for instance, who frankly admitted
that he had found nothing in Switzerland to justify such a verdict
being passed on its Catholic population, and was generous enough
to acknowledge this.
Nor are the children who cover the Rigi, selling fruit and flowers,
idlers in any way. The law requires their attendance at school up to
the age of eight all the year round, but from eight to twelve only
during the winter months. This arrangement has been made in order
that they may accompany their parents to the upland châlets, or, as
often happens, mind the cattle alone on the higher pastures. A most
interesting class they are, and one must ardently pray that nothing
may ever change or modernize them, according to the present ideas
of so-called “civilization”!
For several days we took up our abode at Kaltbad, and never had
cause for one moment's regret. The hotel is in itself a marvel of
material comfort and luxury at such an altitude; the air brisk,
invigorating, and yet balmy, and the views simply lovely. Who can
forget the terrace facing the Uri-Rothstock, [pg 398] Tittlis, and
many another peak and pass, and overhanging Vitznau, whence we
could even distinguish my favorite red standard floating over its
hotel, as the steamers came and went to Lucerne or Fluelen, and
the light smoke of the engines told that the trains were creeping up
towards us? Sometimes, it is true, the lake and all below were
hidden by the clouds that settled in thick masses over the water or
floated beneath us in light, vapory forms, while the heights and
summits opposite shone, like Kaltbad, in brilliant sunlight; making us
more fully realize the great elevation we were inhabiting in such
tranquillity.
Then, the mornings spent in the “Wilderness,” which is represented
nowadays by fir-trees, descendants of those the three sisters knew,
but at present embedded in velvety turf on the hillside, with seats
and tables carefully placed at the best points of view! And the dear
little church to turn into at all times and hours, with the lamp ever
burning, and never quite empty! The afternoons we devoted to
longer excursions, ascents and descents in all directions. That to the
Kulm, or Summit, was made by rail, despite its terrors and perils.
The young people insisted on our making the experiment, but they
could not succeed in persuading us elders to return, except on foot!
The Kaltbad world seems to go through the ordeal unconcernedly;
but nervous and uncomfortable work it must always be, no matter
how custom may familiarize them with it. One spot especially is most
alarming, where the precipice seems to go straight down from the
railroad to the plain many thousand feet below. As a matter of
course, the sunset at the Kulm is the great event on the Rigi—one,
however, which altogether depends upon the weather. We were
most fortunate in catching a clear atmosphere, and consequently
distinct horizon. Then, sleeping at the large hotel at the top, we
included the famed sunrise in the same excursion. Oh! for the pen of
poet to describe either of these sights properly. They are among
those grand scenes which nature holds so completely in her own
keeping that no rush of commonplace humanity can ever lower or
vulgarize them. Crowds from all countries were present, yet we saw
nothing save the glorious panorama before us—the sun sinking
grandly behind the Jura Mountains in the west, or rising majestically
from behind the Sentis far away in Appenzell, after having first
heralded his approach by coloring with the light touch of “rosy-
fingered morn” the Finster-Aarhorn, Wetterhorn, Monk, and
Jungfrau, as they stand in gradual succession, facing the east, in the
Bernese Oberland.
Here, too, were all the scenes of that famous Swiss history which we
had been studying within the last few days—the town of Schwytz in
the Urschweiz, bright and cheerful on its fresh, green meadows;
Lomerz, where Stauffacher commenced the great revolution; the
small lake of Egeri, the site of the battle of Morgarten; Kappel, on
this side of the Zurich line of hills—the Albis—with its monument to
Zwingle, who was killed here in battle against the Schwytzers;
Königsfelden, further north, the scene of Albrecht's murder, and,
later, the site of the sanguinary Agnes' convent; Küssnacht at our
feet, with Tell's Chapel close by, the object of my guide's
pilgrimages, and where the fatal arrow is said to have entered
Gessler's heart; the [pg 399] Lake of Sempach, and Lucerne towards
the northwest—every spot, in short, hallowed by some memory
sacred to Swiss patriotism or piety.
A circumference of three hundred miles is said to be included in this
panorama, dotted here and there with thirteen lakes, distinguishable
in clear weather. But it needs a mountaineer's eye to detect this
number, for, though they certainly do exist, as proved by the map,
even the youthful sight of George C—— and his sister failed to count
more than eleven. The other two had “to be taken on trust,” on the
word of the guides, who declared that particular gleams of sunlight
rested on distant waters. But it is not the number of lakes or the
extent of view which gives such renown to this favorite spot. It is the
grand poetry of its nature, the interest of its associations, and that
great, indescribable influence which the poet addresses as
“Spirit of Beauty, that dost consecrate
With thine own hues all thou dost shine upon.”
Amongst the pleasantest of many pleasant memories, that of
Sunday at Kaltbad stands forth pre-eminent. The weather was
brilliant, and high and low appeared in corresponding costume. It
cannot be said that in the hotel proper the day was altogether
sanctified or edifying; for, except the Catholics, the English
Protestants, and a rare few others, the foreigners show little outward
sign of remembering the day. Indeed, one lady ingenuously
confessed her surprise that we should be so careful about attending
church, considering that she never thought of it whilst “taking the
waters,” as she liked to fancy she was doing at Kaltbad. “Who did?”
she asked; and certainly it looked as if the majority were of her way
of thinking. Not the peasants, however, and let us hope that their
example may yet influence the strangers. Alas! alas! how one
trembles, lest the reverse may be the result of this inroad of
“civilized” multitudes to their midst! But so far no harm seems to
have come of the contact. As the hour for Mass drew near, men and
women were to be seen coming from various points, and when we
reached the church it was so full that a large overflow of the
congregation had taken up their position in the little porch outside.
It seemed as though the history of the past century would repeat
itself over again; that a new church would become necessary, and
another new tablet be put up, telling future generations that the
present one had “proved insufficient for the number of Alpine
inhabitants and pilgrims.” No sight could be prettier, considering the
locality, the bright sun, and all these people in their Sunday dress. In
the latter particular, however, one peculiarity had a singular effect,
namely, that on the Rigi “full dress” for the men seems to consist in
the absence of their outer coats, and the Sunday distinction is
shown only by the snow-white linen of their shirt-sleeves and collars.
All had their alpenstocks and their prayer-books, which they read
devoutly during the whole time. Anna and I also remained outside,
as there was no room within; but we heard every word distinctly,
and could see the altar through the open door and windows. The
service began by an oblation of the Mass and the Acts of Faith,
Hope, and Charity in German, in the very manner and words used in
so many other countries, but notably in all the churches of Ireland.
This was followed by a good sermon, in which the preacher chiefly
urged the necessity [pg 400] of “keeping holy the Sabbath day,” of
living in peace and concord, but likewise of holding fast to the
principles of religion, “like their forefathers of old,” of whose virtues
and steadfastness he spoke in glowing language. It was the first
sermon we had had an opportunity of listening to in these parts, and
it was very curious to hear, even in a small out-of-the-way place of
this kind, such allusions thus brought in as a matter of course, and
so thoroughly in accordance with Herr H——'s predictions. At its
termination we were surprised to see half a dozen of the hotel
guests rise and leave; but these, we later learnt, were Lutherans,
who, having no chaplain of their own, find no difficulty in coming to
the preliminary part of the Catholic service, though they consider it
their duty to leave before Mass commences. It was a curious
instance of liberalism, and of the little essential antagonism German
Protestants entertain towards the Catholic Church. At the end of
Mass a prayer was said in German in honor of the Five Sacred
Wounds, joined in by all, after which the congregation dispersed,
some to the front of the hotel, and others in various directions. On
these days alone a few picturesque costumes appear, but they are
generally from other parts, as the Rigi boasts of nothing special of
this kind. To-day two women in bright bodices covered by silver
buttons and crosses, and with silvered head-dresses, enlivened the
group of women—relations of the clerk coming, they said, to visit
this spot from Bürglen, a long distance on the other side of the lake,
and beyond Sachslen, the sanctuary of “Bruder Klaus.”
Not wishing to disturb our Anglican friends, who were singing hymns
and performing their service in one of the drawing-rooms of the
house, Anna and I sauntered past the “Wilderness,” until we reached
the Käuzli. The atmosphere was most clear, and the landscape so
enchanting that a rest here seemed a fitting and heavenly portion of
our morning worship. Weggis lay below; its church and the children's
corner, where I had stood lately gazing upwards in this direction,
were at our feet, and Lucerne, with its girdle of battlemented walls
at the upper end of the lake, further north, its houses and boats
distinctly visible in the transparent atmosphere. The peasants could
be seen here and there returning to their gray-roofed châlets, but,
save the tinkling bells of the light-limbed cattle browsing in our
neighborhood, no sound broke the perfect stillness of the scene. All
at once the peal of Lucerne Cathedral came booming to us across
the waters! It was eleven o'clock, which in those cantons is the
Angelus hour, and in a moment the deep-toned bell of Weggis sent
its sound up to our very resting-place. Then swiftly the echo was
caught up by the churches of all the numberless pretty villages that
here cover the land, until the whole country seemed to sound as
with but one note. A more thrilling instance of faith and practice it
were impossible to imagine, and, looking down at such a moment at
this fruitful, prosperous district, one felt as if our Lord had already
heard its prayers, and in his mercy blessed it.
Our afternoon walk was this day directed to the other Rigi sanctuary,
“Maria zum Schnee,” or Mary of the Snow, the same mentioned in
the Kaltbad tablet, and which, from Wordsworth's beautiful poem,
has obtained a more world-wide [pg 401] name than its pretty
neighbor; though in the locality itself no difference in celebrity is
admitted between the two. The only striking distinction is that whilst
Kaltbad has but the one simple appellation, “Mary of the Snow”
rejoices in a pet name, by which it is more generally known on the
Rigi, where Klösterli, or “the little convent,” is its familiar and every-
day title. It lies deep in a southern fold of the mountain, unseen
from Kaltbad, but only a couple of miles distant; so that it is a
favorite walk with those visitors whose strength is unequal to the
longer excursions. This year the charms of the mountain-road have
been sadly interfered with by the blasting of rocks necessary to the
making of the railway branch to the Scheideck, and another line up
from Arth to the Staffel, besides the building of an additional hotel,
all which modern material improvements make one look forward
with trepidation to their future effect on the old inhabitants. In a few
years more these heights will be one vast mountain-city—a new
phase of life, which may have its own poetic side, it is true, and
bring health and advantage to humanity in general, but which,
during two or three months of the year, so completely changes the
old character of the beautiful mountain that its friends of twenty and
thirty years' standing say they can no longer recognize its former
simplicity. Hence our musings were somewhat melancholy, as we
wandered on above the new railway-line, until, from a bend in the
hill, we unexpectedly came in sight of a completely new scene, the
curious Mythen rocks rising above Schwytz, in the distance, and
Klösterli itself lying peacefully below us, as if sheltered from all harm
in a dell beneath the Kulm! It seemed a spot exactly made for snow,
and one could almost fancy it buried at times under the soft
embrace of some snow-white drift. Whether the name first came
from this circumstance of its position, or from its connection with the
Basilica of Santa Maria Maggiore at Rome, we had no opportunity of
ascertaining; but, whatever the cause, the name and connection
seemed most appropriate. Certain it is that the painting which is the
chief ornament of S. Maria zum Schnee is a copy of the one at the
great basilica, and, moreover, that the church at Klösterli has been,
as is fitting, affiliated to the one in Rome. The festival is kept on the
same day, the 5th of August, and the Rigi church was consecrated
by a Papal Nuncio in 1700, and endowed since then with many
privileges by Pope Clement XII., so that the link in interest and
connection has never been wanting. Mr. C—— knew all the
particulars, and as we descended the steep pathway to Klösterli he
recalled to us the beautiful tradition about the foundation of Santa
Maria Maggiore. He reminded us how a Roman senator and his wife
having been converted to Christianity, the latter had a dream which
made her believe they ought to build a church in honor of the
Blessed Virgin. Her husband, however, dismissed the idea as a fancy
of her brain, until, having had the same dream for three successive
nights, his wife on the last occasion understood that she ought to
choose the site which should be covered with snow on the following
morning. Her husband, still unwilling, accompanied her in the
search, when, not far from the house, they found the top of the
Esquiline Mount completely [pg 402] covered with a fine crust of
snow! This occurred on the 5th of August, and, bringing conviction
to the husband's mind, he at once consented to give up his fortune
for the purpose, and built on the spot the Basilica, which now covers
the extent of ground marked out by the fall of snow. Another version
states that it was the result of a vision which the pope, S. Liberius,
and John, the patrician, had on the same night, and which was
confirmed the following morning, the 5th of August, by a miraculous
fall of snow, which extended over the space the church was to
occupy. Certain it is that the fall of snow occurred, on this very spot
too, and that the recollection of this wonderful origin is still kept
alive in Rome. On the Feast of Santa Maria ad Nives, on the 5th of
the hot month of August, a shower of white leaves is made to fall on
the congregation attending High Mass at the great Basilica. What
affiliation, therefore, could be more fitting for a mountain chapel?
With renewed interest we hurried to the spot. The village consists
entirely of a few inns, the convent—where live the Capuchin fathers
who have care of the church—and of the church itself, much larger
than that at Kaltbad, and which forms the centre of the whole place.
The old character is maintained up to the present time, these inns
being still most homely—very different from the luxurious abodes
elsewhere on the mountain—and the convent in reality an hospice
for pilgrims, which at once gives the impression of a higher aim than
mere pleasure-seeking. The Capuchin fathers, who glide about with
serious mien in their brown habits, add to the solemnity, further
increased by the depth of the valley “making sunset,” as the sailors
say, to the place long before it happens on the surrounding heights.
It has nothing cheerful or peculiarly attractive to the general public,
so one might hope that it would escape the contagion of a worldly
spirit. This year the gloom has been added to by a dreadful accident
connected with the unwelcome railway, and one heard of little else
on the spot. A young lady who was sitting with her father outside
the Sonne Hotel, writing at one of the small tables, was suddenly
struck by a large stone, thrown by the blasting of a rock close by,
and died in less than half an hour. She was to have gone away from
Klösterli on the previous day with the rest of her family, but had
remained a while longer merely to take care of him. His grief,
consequently, was overwhelming. It was a melancholy inauguration
of the “iron road,” and for the moment made a deep impression on
all concerned. But it is much to be dreaded that it will not be a
lasting one. The father, to whom we spoke, shook his head gravely,
as he pointed to the railway works, expressing his fears that from a
place of pilgrimage they would soon convert his dearly-loved
Klösterli into a simple Curort, or, in modern parlance, a Sanatorium.
He complained of its baneful influence already; for, though the
peasants are thoroughly good and pious, the immense influx of
tourists gives them little time for devotions during the summer
season, especially in the month of August, when the church festival
occurs. They, the monks, belong to the large Capuchin convent at
Arth, from which two or three have been sent here at the special
request of the commune, ever since the foundation, to take care of
this church and attend to [pg 403] the wants of the pilgrims. But the
numbers of the latter are diminishing from the above causes, and
hospitality has this year been chiefly bestowed on invalid priests,
who here seek change of air for weeks at a time. The procession
similar to that from Weggis, which used to come up from Arth for
the 5th of August, making the Stations on the way, did not take
place this time. Nor had the people leisure, either, for their old
games, which followed the church services as a matter of course.
Sad and melancholy, he seemed fearful of this inroad of materialism
and the many temptations to which the poorer classes may be
exposed. The tranquillity of the spot will doubtless be ruined by the
puffing engine and obtrusive railway, and we could not but rejoice
doubly that the “haven of rest” at Kaltbad lies safely hidden away
behind its rocks out of reach of such disturbance. But so many have
been the prayers answered and hearts cured within the last two
centuries by the intercession of holy “Mary of the Snow” that it is
hard to believe so favored a sanctuary, though this may perhaps be
a moment of transition, will be altogether swept away or lose its
holy influence on so essentially pious a population. The church is
crowded with ex-votos, many of them the same seen by Wordsworth
in 1820, when he sang in the following strain of
“Our Lady Of The Snow.
“Meek Virgin Mother, more benign
Than fairest star upon the height
Of thy own mountain set to keep
Lone vigils thro' the hours of sleep,
What eye can look upon thy shrine
Untroubled at the sight?
“These crowded offerings, as they hang
In sign of misery relieved,
Even these, without intent of theirs,
Report of comfortless despairs,
Of many a deep and cureless pang
And confidence deceived.
“To thee, in this aërial cleft.
As to a common centre, tend
All sufferings that no longer rest
On mortal succor, all distrest
That pine of human hope bereft,
Nor wish for earthly friend.
“And hence, O Virgin Mother mild!
Though plenteous flowers around thee blow,
Not only from the dreary strife
Of winter, but the storms of life,
Thee have thy votaries aptly styled
Our Lady of the Snow.
“Even for the man who stops not here,
But down the irriguous valley hies,
Thy very name, O Lady! flings,
O'er blooming fields and gushing springs,
A holy shadow soft and dear
Of chastening sympathies!
“Nor falls that intermingling shade
To summer gladsomeness unkind;
It chastens only to requite
With gleams of fresher, purer light;
While o'er the flower-enamelled glade
More sweetly breathes the wind.
“But on!—a tempting downward way,
A verdant path, before us lies;
Clear shines the glorious sun above;
Then give free course to joy and love,
Deeming the evil of the day
Sufficient for the wise.”
In our walk hither along the brow of the hill we had talked to some
pretty, bright-eyed children running about to call in their father's
cattle, asking their names and other questions; but, returning the
same way, all our thoughts and attention were given to the distant
sound of avalanches, which the C——s declared came to us across
the mountain-tops from the region of the great Oberland range.
Anything more sublime it were difficult to conceive in the fading light
and soft hues of the sunset twilight. We had quite forgotten the
children, but they had been thinking of us, and, passing on by their
châlet, little Aloysius (a fair-haired boy of three years old) was seen
skipping down the green slope with a paper in his hand. It was a
mysterious proceeding, especially when he came and eagerly
presented it to me. But my surprise was greater on reading it to find
that it consisted of prayers printed at Einsiedeln: the first teaching
how to offer up one's intention with the Masses that [pg 404] are
being said all over the world; another to be said when present
during the offertory of the Mass; and a third, when unable to attend
in person, for daily recital at home in union with the priest at the
altar. The little fellow evidently prized it, as taught by his mother,
and it was fortunate that I was able to promise him it should hold a
place amongst my treasures, and that I would say the beautiful
prayers daily, which I have never failed to do. But he could not
altogether know how much happiness his act caused me, chasing
away the gloomy fears of the Capuchin father, and giving bright
hope that a true spirit of piety will grow up with the rising
generation.
C programming from problem analysis to program design 4th ed Edition D  S Malik
Church Song.
“And when they had said an hymn, they went forth to the
Mount of Olives.”—S. Mark xiv. 26.
“Hymnum cecinit, ut et nos similiter faciamus.”—S. Chrysostom.
The Disciple.
A world I'd give to hear thee sing
That song!
Too long
Is life until it bring
The breaking of the bonds that cling
About this deadly flesh.
Sweet Lord, refresh
My weary, longing soul;
And this sad banishment condole
With one faint echo of that strain
Of melody divine, which must remain
Yet murmuring through space
Of all creation's bound;
And so controls
The harmony that rolls
In floods of majesty and grace
Throughout thy dwelling-place,
From tuneful lyres
Of angel choirs,
From ceaseless rapturous songs
Of shining saintly throngs,
That every sound
Heaven hears doth merely seem
Made to accompany thy theme.
Wondrous Singer, O my Lord and King!
Tell me, who taught thee how to sing
So sweet a strain?
[pg 405]
The Master.
I heard my Mother's voice one morn,
Whilst yet in womb unborn,
Chanting the canticle of praise
She still in heaven doth raise;
And when a boy, oft at her knee,
She did the tuneful mystery
Unfold to me.
Wouldst hear me sing?
'Tis no hard thing.
Go, hearken to the singing of my Bride
With whom my Presence ever doth abide;
Who is a Mother unto thee,
Like as the Virgin, full of grace, to me.
Her voice, in melody her own,
If thou wilt mark its heavenly tone,
Hath cunning art
To make thy heart
Hear mine again.
C programming from problem analysis to program design 4th ed Edition D  S Malik
A Discussion With An Infidel.
XVIII. Personal Continuance.
Reader. The next question you treat, doctor, regards the immortality
of the human soul, or, as you call it, “personal continuance.” In your
opinion the spirit and the body, the soul and the brain, are so
intimately and inseparably connected that a soul without a body, as
“force without matter,” can never exist. I remember having already
answered some of the grounds of this opinion; but as you make
“personal continuance” the subject of a special chapter, I presume
that it is in this chapter that you have condensed the strength and
substance of all your arguments. How do you, then, establish your
position?
Büchner. “A spirit without a body is as unimaginable as electricity or
magnetism without metallic or other substances” (p. 196).
Reader. Unimaginable! Of course, a spiritual substance is not the
object of imagination. Perhaps you mean that it is unthinkable,
inconceivable, or unintelligible; which I deny.
Büchner. “Unprejudiced philosophy is compelled to reject the idea of
an individual immortality and of a personal continuance after death.
With the decay and dissolution of its material substratum, through
which alone it has acquired a conscious existence and become a
person, and upon which it was dependent, the spirit must cease to
exist” (ibid.)
Reader. Beware of fallacies, doctor. You have not yet proved that the
human soul needs a material substratum. Again, you merely assume
that it is through the body [pg 406] that the soul has acquired a
conscious existence, whilst the fact is that the soul through itself is
conscious of its own existence in the body. Moreover, the soul does
not become a person through the body it informs, but, on the
contrary, confers on the body the privilege of being a part of the
person. Lastly, the spirit is not dependent upon the body, except for
the sensitive operations; and you cannot assume that the soul
depends upon the body for its own being. Hence your conclusion is
yet unproved.
Büchner. “All the knowledge which this spirit has acquired relates to
earthly things; it has become conscious of itself in, with, and by
these things; it has become a person by its being opposed against
earthly, limited individualities. How can we imagine it to be possible
that, torn away from these necessary conditions, this being should
continue to exist with self-consciousness and as the same person? It
is not reflection, but obstinacy, not science, but faith, which supports
the idea of a personal continuance” (pp. 196, 197).
Reader. I am rather amused than embarrassed at your identifying
reflection with science and obstinacy with faith, as I know that you
are absolutely incapable of accounting for such a nonsensical
ranting. It is not true that “all the knowledge acquired by our soul
relates to earthly things.” We have already discussed this point, and
shown that our knowledge of earthly things is only the alphabet of
human knowledge. Nor is it true that our soul “has become
conscious of itself by such things.” Consciousness is, even
objectively, an immanent act, and the soul cannot be conscious of its
own self, except by looking upon itself. No one can say I perceive
without a knowledge of the I; and therefore the soul knows its own
self independently of the perception of other earthly things. But, as
there are philosophers who account for self-consciousness by the
primitive accidental sensations experienced by the child, I will
suppose with you that our soul becomes conscious of its own
existence by means of such sensations. Does it follow from this that
the union with the body is “a necessary condition” for the existence
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!
ebookultra.com

More Related Content

PDF
C programming from problem analysis to program design 4th ed Edition D S Malik
PDF
C programming from problem analysis to program design 4th ed Edition D S Malik
PDF
C Programming From Problem Analysis To Program Design 5th 5th Edition D S Malik
DOCX
C++ PROGRAMMINGPROGRAM DESIGN INCLUDING DATA STRUCTURES.docx
PDF
C Programming Program design including data structures 5ed. Edition Malik D.S.
PDF
C Programming From Problem Analysis To Program Design 8th Edition Ds Malik
PDF
C Programming From Problem Analysis To Program Design 6th Edition D S Malik
PDF
Ds C+++Programming+From+Problem+Analysis+to+Program+Design+_5th+Edition_+book...
C programming from problem analysis to program design 4th ed Edition D S Malik
C programming from problem analysis to program design 4th ed Edition D S Malik
C Programming From Problem Analysis To Program Design 5th 5th Edition D S Malik
C++ PROGRAMMINGPROGRAM DESIGN INCLUDING DATA STRUCTURES.docx
C Programming Program design including data structures 5ed. Edition Malik D.S.
C Programming From Problem Analysis To Program Design 8th Edition Ds Malik
C Programming From Problem Analysis To Program Design 6th Edition D S Malik
Ds C+++Programming+From+Problem+Analysis+to+Program+Design+_5th+Edition_+book...

Similar to C programming from problem analysis to program design 4th ed Edition D S Malik (20)

PDF
C Programming Program design including data structures 5ed. Edition Malik D.S.
PDF
Java programming from problem analysis to program design 5th ed Edition D S M...
PDF
C Programming Program Design Including Data Structures 5th Edition D. S. Malik
PDF
(Ebook) C Primer Plus Sixth Edition by Stephen Prata
PDF
C Programming Program Design Including Data Structures 5th Edition D. S. Malik
PDF
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
PDF
C Programming Program Design Including Data Structures 5th Edition D. S. Malik
PDF
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
PDF
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
PDF
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
PDF
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
PDF
Computer Programming With C Kunal Pimparkhede
PDF
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
PDF
(eBook PDF) C++ How to Program 10th Edition by Paul J. Deitel
PDF
(eBook PDF) C++ How to Program 10th Edition by Paul J. Deitel
PDF
Intake_35_Professional_Developer_Track_SD
PDF
Intake_35_Professional_Developer_Track_SD
PDF
Intake_35_Professional_Developer_Track_SD
PDF
Essential C 8 0 7th Edition Mark Michaelis Kevin Bost Editor Eric Lippert Editor
PDF
Embedded Systems: The Future of Computing
C Programming Program design including data structures 5ed. Edition Malik D.S.
Java programming from problem analysis to program design 5th ed Edition D S M...
C Programming Program Design Including Data Structures 5th Edition D. S. Malik
(Ebook) C Primer Plus Sixth Edition by Stephen Prata
C Programming Program Design Including Data Structures 5th Edition D. S. Malik
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
C Programming Program Design Including Data Structures 5th Edition D. S. Malik
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
Computer Programming With C Kunal Pimparkhede
(Original PDF) C++ Programming From Problem Analysis to Program Design 8th
(eBook PDF) C++ How to Program 10th Edition by Paul J. Deitel
(eBook PDF) C++ How to Program 10th Edition by Paul J. Deitel
Intake_35_Professional_Developer_Track_SD
Intake_35_Professional_Developer_Track_SD
Intake_35_Professional_Developer_Track_SD
Essential C 8 0 7th Edition Mark Michaelis Kevin Bost Editor Eric Lippert Editor
Embedded Systems: The Future of Computing
Ad

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Cell Structure & Organelles in detailed.
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
RMMM.pdf make it easy to upload and study
PPTX
Presentation on HIE in infants and its manifestations
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
A systematic review of self-coping strategies used by university students to ...
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Classroom Observation Tools for Teachers
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Supply Chain Operations Speaking Notes -ICLT Program
Cell Types and Its function , kingdom of life
Pharmacology of Heart Failure /Pharmacotherapy of CHF
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Cell Structure & Organelles in detailed.
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Anesthesia in Laparoscopic Surgery in India
Microbial diseases, their pathogenesis and prophylaxis
Final Presentation General Medicine 03-08-2024.pptx
RMMM.pdf make it easy to upload and study
Presentation on HIE in infants and its manifestations
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
A systematic review of self-coping strategies used by university students to ...
STATICS OF THE RIGID BODIES Hibbelers.pdf
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Classroom Observation Tools for Teachers
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
Supply Chain Operations Speaking Notes -ICLT Program
Ad

C programming from problem analysis to program design 4th ed Edition D S Malik

  • 1. C programming from problem analysis to program design 4th ed Edition D S Malik download https://ebookultra.com/download/c-programming-from-problem- analysis-to-program-design-4th-ed-edition-d-s-malik/ Explore and download more ebooks or textbooks at ebookultra.com
  • 2. We have selected some products that you may be interested in Click the link to download now or visit ebookultra.com for more options!. Java TM Programming From Problem Analysis to Program Design 5th Edition D. S. Malik https://ebookultra.com/download/java-tm-programming-from-problem- analysis-to-program-design-5th-edition-d-s-malik/ Problem Solving and Program Design in C Third Edition Jeri R. Hanly https://ebookultra.com/download/problem-solving-and-program-design-in- c-third-edition-jeri-r-hanly/ Introduction to Numerical Analysis 2nd Edition D. C. Sanyal https://ebookultra.com/download/introduction-to-numerical- analysis-2nd-edition-d-c-sanyal/ Visual C 2010 How to Program 4th Edition 1 29 pdf Paul Deitel https://ebookultra.com/download/visual-c-2010-how-to-program-4th- edition-1-29-pdf-paul-deitel/
  • 3. Analysis and Design of Analog Integrated Circuits 4th ed Edition Paul R. Gray https://ebookultra.com/download/analysis-and-design-of-analog- integrated-circuits-4th-ed-edition-paul-r-gray/ Programming and Problem Solving with C Comprehensive Comprehensive Edition Nell B. Dale https://ebookultra.com/download/programming-and-problem-solving-with- c-comprehensive-comprehensive-edition-nell-b-dale/ C how to program Tenth Edition Deitel https://ebookultra.com/download/c-how-to-program-tenth-edition-deitel/ Programming C 2nd ed Edition Jesse Liberty https://ebookultra.com/download/programming-c-2nd-ed-edition-jesse- liberty/ C Programming in Linux 1st edition Edition Haskins D. https://ebookultra.com/download/c-programming-in-linux-1st-edition- edition-haskins-d/
  • 5. C programming from problem analysis to program design 4th ed Edition D S Malik Digital Instant Download Author(s): D S Malik ISBN(s): 9781423902096, 1423902092 Edition: 4th ed File Details: PDF, 11.47 MB Year: 2009 Language: english
  • 6. C++ PROGRAMMING: FROM PROBLEM ANALYSIS TO PROGRAM DESIGN FOURTH EDITION D.S. MALIK Australia Brazil Japan Korea Mexico Singapore Spain United Kingdom United States
  • 7. C++ Programming: From Problem Analysis to Program Design, Fourth Edition by D.S. Malik Senior Product Manager: Alyssa Pratt Acquisitions Editor: Amy Jollymore Content Product Manager: Jill Braiewa Marketing Manager: Bryant Chrzan Editorial Assistant: Patrick Frank Print Buyer: Julio Esperas Cover Designer: Lisa Kuhn, Curio Press, LLC Compositor: Integra Art Director: Marissa Falco Validation: Green Pen Quality Assurance Proofreader: Green Pen Quality Assurance Indexer: Liz Cunningham Printed in Canada 1 2 3 4 5 6 7 14 13 12 11 10 09 08 ª 2009 Course Technology, Cengage Learning ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced, transmitted, stored or used in any form or by any means graphic, electronic, or mechanical, including but not limited to photocopying, recording, scanning, digitizing, taping, Web distribution, information networks, or information storage and retrieval systems, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without the prior written permission of the publisher. For product information and technology assistance, contact us at Cengage Learning Customer Sales Support, 1-800-354-9706 For permission to use material from this text or product, submit all requests online at cengage.com/permissions Further permissions questions can be emailed to permissionrequest@cengage.com ISBN-13: 978-1-4239-0209-6 ISBN-10: 1-4239-0209-2 Course Technology 25 Thomson Place Boston, MA 02210 USA Visual C++ .NET and PowerPoint are registered trademarks of the Microsoft Corporation; Pentium is a registered trademark of Intel Corporation; IBM is a registered trademark of Industrial Business Machines. Disclaimer Course Technology reserves the right to revise this publication and make changes from time to time in its content without notice. The programs in this book are for instructional purposes only. They have been tested with care, but are not guaranteed for any particular intent beyond educational purposes. The authors and the publisher do not offer any warranties or representations, nor do they accept any liabilities with respect to the programs. Cengage Learning is a leading provider of customized learning solutions with office locations around the globe, including Singapore, the United Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at: international.cengage.com/region Cengage Learning products are represented in Canada by Nelson Education, Ltd. For your lifelong learning solutions, visit course.cengage.com Visit our corporate website at cengage.com
  • 10. PREFACE xxvii 1. An Overview of Computers and Programming Languages 1 2. Basic Elements of C++ 29 3. Input/Output 115 4. Control Structures I (Selection) 167 5. Control Structures II (Repetition) 231 6. User-Defined Functions I 307 7. User-Defined Functions II 345 8. User-Defined Simple Data Types, Namespaces, and the string Type 415 9. Arrays and Strings 469 10. Applications of Arrays (Searching and Sorting) and the vector Type 545 11. Records (structs) 603 12. Classes and Data Abstraction 641 13. Inheritance and Composition 717 14. Pointers, Classes, Virtual Functions, and Abstract Classes 785 15. Overloading and Templates 853 16. Exception Handling 943 17. Recursion 981 18. Linked Lists 1017 19. Stacks and Queues 1111 BRIEF CONTENTS
  • 11. APPENDIX A Reserved Words 1219 APPENDIX B Operator Precedence 1221 APPENDIX C Character Sets 1223 APPENDIX D Operator Overloading 1227 APPENDIX E Additional C++ Topics 1229 APPENDIX F Header Files 1251 APPENDIX G Memory Size on a System and Random Number Generator 1261 APPENDIX H Standard Template Library (STL) 1263 APPENDIX I Answers to Odd-Numbered Exercises 1305 INDEX 1327 vi | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
  • 12. Preface xxvii AN OVERVIEW OF COMPUTERS AND PROGRAMMING LANGUAGES 1 Introduction 2 A Brief Overview of the History of Computers 2 Elements of a Computer System 3 Hardware 4 Central Processing Unit 4 Main Memory 5 Secondary Storage 6 Input /Output Devices 6 Software 6 The Language of a Computer 6 The Evolution of Programming Languages 8 A C++ Program 10 Processing a C++ Program 12 Programming with the Problem Analysis–Coding–Execution Cycle 14 Programming Methodologies 22 Structured Programming 22 Object-Oriented Programming 22 ANSI/ISO Standard C++ 24 Quick Review 24 Exercises 26 1 TABLE OF CONTENTS
  • 13. BASIC ELEMENTS OF C++ 29 The Basics of a C++ Program 30 Comments 32 Special Symbols 32 Reserved Words (Keywords) 33 Identifiers 33 Whitespaces 34 Data Types 34 Simple Data Types 35 Floating-Point Data Types 38 Arithmetic Operators and Operator Precedence 40 Order of Precedence 44 Expressions 45 Mixed Expressions 46 Type Conversion (Casting) 48 string Type 50 Input 51 Allocating Memory with Constants and Variables 52 Putting Data into Variables 54 Assignment Statement 54 Saving and Using the Value of an Expression 58 Declaring and Initializing Variables 59 Input (Read) Statement 60 Variable Initialization 63 Increment and Decrement Operators 67 Output 69 Preprocessor Directives 77 namespace and Using cin and cout in a Program 78 Using the string Data Type in a Program 78 Creating a C++ Program 79 Program Style and Form 83 Syntax 83 2 Use of Blanks 84 viii | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
  • 14. Use of Semicolons, Brackets, and Commas 84 Semantics 84 Naming Identifiers 84 Prompt Lines 85 Documentation 86 Form and Style 86 More on Assignment Statements 88 Programming Example: Convert Length 99 Programming Example: Make Change 93 Quick Review 97 Exercises 99 Programming Exercises 107 INPUT/OUTPUT 115 I/O Streams and Standard I/O Devices 116 cin and the Extraction Operator 117 Using Predefined Functions in a Program 123 cin and the get Function 125 cin and the ignore Function 126 The putback and peek Functions 128 The Dot Notation Between I/O Stream Variables and I/O Functions: A Precaution 130 Input Failure 131 The clear Function 133 Output and Formatting Output 135 setprecision Manipulator 135 fixed Manipulator 136 showpoint Manipulator 136 setw 138 Additional Output Formatting Tools 141 setfill Manipulator 141 left and right Manipulators 143 3 Input/Output and the string Type 145 Table of Contents | ix
  • 15. File Input/Output 146 Programming Example: Movie Ticket Sale and Donation to Charity 150 Programming Example: Student Grade 155 Quick Review 158 Exercises 160 Programming Exercises 163 CONTROL STRUCTURES I (SELECTION) 167 Control Structures 168 Relational Operators 169 Relational Operators and Simple Data Types 171 Comparing Floating-point Numbers for equality 171 Comparing Characters 172 Relational Operators and the string Type 173 Logical (Boolean) Operators and Logical Expressions 175 Order of Precedence 177 Short-Circuit Evaluation 181 int Data Type and Logical (Boolean) Expressions 182 bool Data Type and Logical (Boolean) Expressions 183 Selection: if and if...else 184 One-Way Selection 185 Two-Way Selection 187 Compound (Block of) Statements 191 Multiple Selections: Nested if 192 Comparing if...else Statements with a Series of if Statements 196 Using Pseudocode to Develop, Test, and Debug a Program 196 Input Failure and the if Statement 199 Confusion Between the Equality Operator (==) and the Assignment Operator (=) 202 Conditional Operator (?:) 203 4 switch Structures 204 x | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
  • 16. Terminating a Program with the assert Function 211 Programming Example: Cable Company Billing 213 Quick Review 219 Exercises 220 Programming Exercises 225 CONTROL STRUCTURES II (REPETITION) 231 Why Is Repetition Needed? 232 while Looping (Repetition) Structure 233 Designing while loops 235 Case 1: Counter-Controlled while Loops 236 Case 2: Sentinel-Controlled while Loops 239 Case 3: Flag-Controlled while Loops 243 Case 4: EOF-Controlled while Loops 247 eof Function 248 More on Expressions in while Statements 249 Programming Example: Checking Account Balance 250 Programming Example: Fibonacci Number 259 for Looping (Repetition) Structure 264 Programming Example: Classifying Numbers 270 do...while Looping (Repetition) Structure 274 Choosing the Right Looping Structure 278 break and continue Statements 278 Nested Control Structures 281 Quick Review 288 Exercises 290 Programming Exercises 300 5 Table of Contents | xi
  • 17. USER-DEFINED FUNCTIONS I 307 Predefined Functions 308 User-Defined Functions 311 Value-Returning Functions 312 Syntax: Value-Returning Functions 314 Syntax: Formal Parameter List 314 Function Call 314 Syntax: Actual Parameter List 314 return Statement 315 Syntax: return Statement 315 Function Prototype 318 Syntax: Function Prototype 319 Flow of Execution 325 Programming Example: Largest Number 326 Programming Example: Cable Company 327 Quick Review 333 Exercises 335 Programming Exercises 340 USER-DEFINED FUNCTIONS II 345 Void Functions 346 Void Functions without Parameters 346 Void Functions with Parameters 349 Value Parameters 354 Reference Variables as Parameters 356 Value and Reference Parameters and Memory Allocation 360 Reference Parameters and Value-Returning Functions 370 Scope of an Identifier 370 Global Variables, Named Constants, and Side Effects 374 Static and Automatic Variables 376 6 7 xii | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
  • 18. Function Overloading: An Introduction 378 Functions with Default Parameters 380 Programming Example: Classify Numbers 383 Programming Example: Data Comparison 388 Quick Review 398 Exercises 400 Programming Exercises 407 USER-DEFINED SIMPLE DATA TYPES, NAMESPACES, AND THE string TYPE 415 Enumeration Type 416 Declaring Variables 418 Assignment 418 Operations on Enumeration Types 419 Relational Operators 419 Input /Output of Enumeration Types 420 Functions and Enumeration Types 422 Declaring Variables When Defining the Enumeration Type 424 Anonymous Data Types 424 typedef Statement 425 Programming Example: The Game of Rock, Paper, and Scissors 426 Namespaces 437 string Type 442 Additional string Operations 446 length Function 446 size Function 448 find Function 449 substr Function 452 swap Function 454 Programming Example: Pig Latin Strings 454 8 Quick Review 460 Table of Contents | xiii
  • 19. Exercises 463 Programming Exercises 466 ARRAYS AND STRINGS 469 Arrays 471 Accessing Array Components 472 Processing One-Dimensional Arrays 475 Array Index Out of Bounds 479 Array Initialization During Declaration 480 Partial Initialization of Arrays During Declaration 480 Some Restrictions on Array Processing 481 Arrays as Parameters to Functions 482 Constant Arrays as Formal Parameters 483 Base Address of an Array and Array in Computer Memory 485 Functions Cannot Return a Value of the Type Array 488 Integral Data Type and Array Indices 491 Other Ways to Declare Arrays 491 C-strings (Character Arrays) 492 String Comparison 494 Reading and Writing Strings 496 String Input 496 String Output 497 Specifying Input/Output Files at Execution Time 498 string Type and Input/Output Files 498 Parallel Arrays 499 Two- and Multidimensional Arrays 500 Accessing Array Components 502 Two-Dimensional Array Initialization During Declaration 503 Two-Dimensional Arrays and Enumeration Types 503 Initialization 507 Print 507 Input 507 Sum by Row 508 Sum by Column 508 9 xiv | C++ Programming: From Problem Analysis to Program Design, Fourth Edition
  • 20. Largest Element in Each Row and Each Column 508 Reversing Diagonal 509 Passing Two-Dimensional Arrays as Parameters to Functions 511 Arrays of Strings 514 Arrays of Strings and the string Type 514 Arrays of Strings and C-Strings (Character Arrays) 515 Another Way to Declare a Two-Dimensional Array 516 Multidimensional Arrays 517 Programming Example: Code Detection 518 Programming Example: Text Processing 525 Quick Review 532 Exercises 534 Programming Exercises 539 APPLICATIONS OF ARRAYS (SEARCHING AND SORTING) AND THE vector TYPE 545 List Processing 546 Searching 546 Bubble Sort 551 Selection Sort 555 Insertion Sort 559 Sequential Search on an Ordered List 566 Binary Search 569 Performance of Binary Search 572 vector Type (class) 574 Programming Example: Election Results 579 Quick Review 595 Exercises 597 Programming Exercises 600 10 Table of Contents | xv
  • 21. Random documents with unrelated content Scribd suggests to you:
  • 22. trees. The whole of this portion is on the site of the former land-slip, now the richest and most highly-cultivated district of the mountain. On every side the views were enchanting; Mount Pilatus standing forth in all his grandeur just opposite, displaying folds and tracts of pasture-ground we had not attributed to his rugged form. Lost in admiration, we rode on in comparative silence, until we halted, to refresh the men and horses, at a café under a splendid tree, and soon after reached a chapel sheltered by a rock, called in our hand- book the Heiligenkreuz, or Church of the Holy Cross. “The beginning of the Stations to Kaltbad,” said my guide, a dark-eyed, refined- looking man, who had spoken but little hitherto. “Stations to the Wallfahrtort, or place of pilgrimage at Kaltbad,” he repeated, noticing my perplexed countenance. “Kaltbad is a Gnadenort, or ‘place of grace,’ to us, madam,” he continued, “although you perhaps only know it as a Curort.” And such was the sober truth. I had never heard it spoken of as anything but a huge hotel with salubrious air. So now I entered into conversation with my guide, and found that he constantly made the Stations, in common with all the Weggis population, up this rugged ascent, until they reach the church at Kaltbad. “Would I not go to see the church?” he asked. “It was indeed a Gnadenort. But the feast of the year I could not see, for it takes place in the middle of May, just before the flocks are sent up to the summer pastures. Then there is a procession up the mountain, with the banner we had noticed in the parish church—the white cross on the red ground.” So here was the explanation of its place of honor inside the sanctuary—one more reason why the Weggis folks should hold it dear and we strangers regard it with reverence. Nay more: should we not love and cherish a flag which not only symbolizes, but is practically used by, a modern free people in connection with their highest and noblest feelings? “In this procession, headed by the priest,” my informant continued, “we, the people, make the Stations with hymns and prayers as we go up, and, after first visiting the Kaltbad church, all ends by the priest blessing the pastures on all sides before the cattle are permitted to be brought up to them for
  • 23. the summer season.” The higher we ascended, the steeper became the road under a straight face of rock, and we could readily fancy how picturesque, even from an artist's point of view, such a procession must be, headed by the red flag, winding its way up this rugged mountain-road; but, combined with the spirit and faith which animate it, it is impossible to conceive anything more beautiful. This peasant was a native of Weggis, and soon grew communicative. “Oh! yes, he had often been to Einsiedeln; every one in that country had many, many times made the pilgrimage there.” And in fervent language he described the place to me. He had also been to Tell's Chapel often, but not yet to Tell's Platform. That was the great object of his ambition, what he most wished to accomplish, with a visit to Sachslen to see “Bruder [pg 393] Klaus,” as so many of his neighbors had done; but another year should not pass without his carrying out his intentions. Amidst conversation of this kind we climbed up the straight wall of rock, which seemed to have no issue, until suddenly we reached a curious group called the Felsenthor, composed of large fragments fallen from above exactly in the semblance of a “rocky gate,” as the name implies, and whence the view is magnificent. The afternoon was lovely. At each turn one snowy peak after another had been coming into view. The air, though warm, was fresher and brisker than at Weggis, while the vegetation had sensibly changed from the luxuriant chestnuts to the pines and fir- trees of the Alpine heights. Nothing could be more poetic and tranquil than our half-hour's repose at this beautiful point, noticing the approach of sunset-tints on the mountain-wall just opposite which overhangs Vitznau; watching the pretty steamers looking like dragon-flies hovering over the lake two thousand feet below; and then reflecting on the faith and piety of our humble attendants, which shed a vivifying atmosphere over the whole scene. Our minds were still full of these thoughts as we set forth again for our last ascent to Kaltbad, about three-quarters of an hour distant, through a pretty dell of fallen rocks and fresh verdure. We had quite forgotten
  • 24. the existence of the railway or its feverish life, when all at once a turn in the road gave a rude shock to our peaceful meditations. There were the trains laboring up a barren, steep hill beside us—one that would be too steep for any horse without three or four zigzag turns and windings. Three separate trains were coming up at certain distances in succession, the engines puffing and snorting, panting and laboring, in the effort to push the one carriage before each, as though the struggle were too much for their fast-failing strength. It made one tremble to watch them, and it seemed impossible to comprehend how the passengers looked so quiet and unconcerned. How Mrs. C—— and I congratulated ourselves on having kept old- fashioned ways and despised “progress,” at least for once in our travels! And when I also thought of the varied charms of our ride, and all that I had seen of the population and their ways, I felt that no one who rushes through a country at high-pressure railway speed can ever hope to understand its people half as well as those who come into closer contact with them. Before we had time to recover from the impressions of the railway, Kaltbad itself appeared in sight, high above our heads, like a green- jalousied monster of some German watering-place lifted bodily up from the depths below. Anything more unpoetic than its first view is not to be found; though it must at once be admitted that first impressions are not to be trusted in this particular case. It was a cruel shock, however, to our visions of pious pilgrimages and processions; a return to the prose of life we had never contemplated at four thousand four hundred and thirty-nine feet above the level of the sea. Our young friends were anxiously awaiting us on the long terrace in front of the hotel with such sensational accounts of their railway journey as might well have obliterated all remembrance of the Wallfahrtort, or “place of pilgrimage,” but for the parting reminder of my guide, that “the church was behind [pg 394] the house, and he hoped I would be sure to see it.” But the C——s' only thought now was of the sunset about to take place, and they hurried us off,
  • 25. without a moment's delay, to a beautiful spot, called the Käuzli, ten minutes' distance from the hotel. Certainly no view could be more glorious! Before us spread half the northern portion of Switzerland— Mount Pilatus right opposite, Lucerne at our feet, Sempach, the great lake, just beyond, bathed in a flood of crimson, as though in harmony with its memories, and bringing back to our minds at one glance Arnold von Winkelried and all the grand history related to us so recently by Herr H——. The seven great peaks of the Oberland, including the Wetterhorn, Monk, and Eiger, towered above the clouds to our right, while the summits on the south, half facing the sunset, were lit up by the same kaleidoscopic coloring that we had witnessed on the first evening of our arrival at Lucerne. Spell-bound by this fairy-like scene, we lingered here till nearly dark, and it seemingly became too late to seek out the little church. But young C —— had discovered it that afternoon, and led me by an intricate back pathway to its very door. Even at that late hour it was open, the lamp burning before the altar, and many figures could be distinguished devoutly praying in the twilight. These, as I afterwards learned, were servants of the hotel—the laundresses, bath-women, and porters, who came to pay their visit to the Blessed Sacrament before retiring to rest after their busy day's work. Mass was celebrated every morning at half-past seven o'clock, they said. My own devotions over, I was again led back to the hotel, where the brilliantly-lighted rooms and crowd of fashionably-dressed ladies— although the material comforts are by no means to be despised— were still in harsh discord with our ideas of mountain life. Next morning, as if we had been in the plain, the church-bell tolled at the stated hour, and found us ready to sally forth in answer to its call. In the hotel all was bustle and clatter; but what wonder? Three hundred guests and upwards have, on an average, to be provided for daily during the season. In the middle of July four hundred and twenty were at one time under this roof, but, happily for us, the numbers had now sensibly decreased. No church, however, was visible, and it was only on inquiry that I found a pathway in the rear of the house leading behind two rocks—a true Felsenthor, or “rocky
  • 26. gate,” they made—hiding away their little treasure. Once past them, there stood the church, with the sun shining on its roof, small and simple, but perfect in all its proportions, nestling amongst the encircling crags and overhanging trees, from amidst which, opposite the door, trickled a stream of the clearest water. Mass had just commenced at the centre altar, over which stood a statue of the Blessed Virgin and Child, surrounded by a garland of flowers, and two bouquets were laid, evidently as a pious offering, on the two side altars, which were also adorned by excellent paintings. A handsome silver lamp hung in the sanctuary, and there was a confessional, besides benches capable of accommodating a couple of hundred people, all neatly painted and very clean. To-day the congregation was small, for the servants could not be spared, we were told, at that hour from their work, and [pg 395] there were few Catholic visitors in the house; but we noticed that the clerk rang the church-bell at the Gospel and the Elevation, so that the shepherds and others scattered about on the mountain might join their intention with the priest at the altar. Nothing could exceed the quiet of the spot. It might have been miles away from the noisy world hard by, no sound audible but the trickling of the stream outside, heard through the open door, and enhancing the deep tranquillity of the scene. A most perfect haven of rest it made for weary souls or pious pilgrims, and a worthy aim, with the constant presence of the Blessed Sacrament, for any procession toiling up the precipitous mountain-side. When Mass was over, we lingered awhile, and, looking round, a large, illuminated tablet caught our attention. What was our delight to find it gave the whole history of the place in the following words: “Kaltbad on the Rigi. “Amongst the venerated spots which the goodness of God seems to have especially chosen for the distribution of rich spiritual and temporal gifts, Kaltbad on the Rigi has for centuries enjoyed a well-founded reputation. The natural
  • 27. operation of the remarkably cold water has in itself given life and health to thousands. But far more effect has been produced by trustful prayers, joined with the contrite and devout reception of the holy sacraments, and aided by the powerful intercession of the pure Virgin-Mother of God and of other saints. Remarkable and often perfectly miraculous cures of countless Christians, in the most different circumstances of body and soul, have here taken place, which have partly been recorded in writing, and partly live on in grateful remembrance. “In former times this place was called the ‘Schwesterborn,’ or ‘Spring of the Sisters’; for the legend relates that in the reign of the Emperor Albert of Austria—in the beginning of the XIVth century—three pious sisters retired to this wilderness in order to escape from powerful governors, or Vogts, and here led holy and saintly lives. The first miraculous cure on record is that of a devout Landsassen of Weggis, named Balthasar Tolen, in the year 1540. From year to year the reputation of this spring increased. In the year 1585, on the 20th of May, the first small chapel was consecrated in honor of God, of the holy Archangel Michael and the other angels, and of the holy shepherd Wendelin, by Balthasar, Bishop of Ascalon. It proved, however, insufficient for the number of Alpine inhabitants and pilgrims. Even after those belonging to the canton Schwytz built themselves a chapel, a hundred years later, at Mary in the Snow, or ‘Maria zum Schnee,’ the want of a larger church was still felt. The present one, with three altars, the middle one of which possesses the image of the ever Blessed Mother of God, and the two side ones the pictures of the holy martyr S. Lawrence and the father of the church, S. Jerome, was built in the year 1779, and considerably renovated in the year 1861, when the two new side altars and their paintings by Theodore von Deschwanden were added. “On the 20th of July, 1782, His Holiness Pius VI. granted a plenary indulgence to all the faithful, on any day whatsoever,
  • 28. on the condition that after approaching the holy sacraments of Confession and Communion, with contrite and worthy dispositions, they here devoutly pray for the union of all Christian princes, the extirpation of heresy, and the increase of the Holy Catholic Church—an indulgence which can be applied to the souls in purgatory. “In order to afford the opportunity of assisting at divine service on Sundays and holidays to the shepherds as well as to the pilgrims, and also of approaching the holy sacraments, a special priest is here appointed during the whole summer season.” So here again, even here, the Austrians and imperial Vogts were at the root of all things—in this instance, however, and unconsciously, the source of good to many poor sufferers; for numberless ex-votos filling the end of the little church eloquently told that it had proved [pg 396] to them a true “place of grace,” as my guide of yesterday had so beautifully called it. And the little stream outside was the real “Kaltbad,” whose wonder-working effects had first given the place its name. Quaint and rude were all the paintings, but full of life and feeling, mostly from the neighborhood—from Weggis, Vitznau, and Gersau. Yes, there was a man in a boat in danger on the lake, just as we had seen from the Gersau hotel two evenings ago; but this one is praying fervently with clasped hands, and we longed to know if those who were saved the other day had done likewise. Then here is a family of boys and girls kneeling in rows, the father and mother behind, all with their pink, and blue, and green rosaries twined round their hands, in the selfsame manner that the Gersau children had theirs during Mass! Above, a child of two years old, kneeling beside its mother, has a rosary hanging on its arm; quaint little things in caps like those of their elders, or infants tied on pillows with quantities of red bows. Red was so much the prevailing color that it seemed as if it must have some reference to their
  • 29. beloved national flag. And then there were small waxen hearts, and ears, and a wooden hand with a fearful gash, the offering, no doubt, of a grateful wood-cutter. Some of these are upwards of a hundred or a hundred and fifty years old, with inscriptions in the native dialect, full of pathos and local color. But most striking of all is a large painting of the very wall of rock up which we had climbed from Weggis yesterday, bearing the following simple-worded inscription: “Be it known to all, that by the breaking up of the dangerous Rigirocks on the Weggis mountain some of the inhabitants were threatened with the complete destruction of all their possessions. In this extremity and distress they turned to heaven, and, with firm confidence in the gracious Mother of all the angels, they here sought and found help; for instantly the loosening of the rocks ceased, and all became quiet again. Therefore, as a perpetual memorial of praise and thanksgiving to God and the Mother of Mercy, they have consecrated and hung up this tablet, anno 1753.” This was clearly forty-two years before the fatal mud-slide which destroyed so much, and it would be most interesting to know whether the later victims turned hitherward for succor; but of this no record exists in the church. In the above painting the Blessed Mother, holding the divine Infant in her arms, is represented standing in the centre of the rock-wall, with S. Michael on one side and S. Lawrence on the other, just as if they had been visible. Had we only beheld this tablet before, with what different eyes should we have looked at this face of rock yesterday from the cemetery below, as also during our ascent! And what proof such a picture and inscription give of the strong faith of the Weggis population in the unseen world under whose blessed protection they live in peace and confidence! Whilst we tarried, peasant after peasant came in. One, an old woman, took out her rosary, and told her beads leisurely; another, younger and busier, laid down her basket, prayed for a few minutes with recollection, and then went on to her work; but what most struck us was a little girl of about twelve, who also had her basket, full of fruit and flowers, and had [pg 397] been there before
  • 30. we arrived for Mass. She waited until we left, and then evidently thought that we had finally departed. Unexpectedly, however, I returned to look at the tablet again, and I beheld the little maiden in the act of dropping some money into the poor box, blushing modestly when her eyes caught mine. I asked, and found that she was a Weggis child—one of the number that climb the mountain like antelopes up to this hotel daily to sell their “fresh figs,” “peaches,” and “flowers”—for they offer them in good English—the majority of whom first pay their visit to the Blessed Sacrament in this church, and leave some little offering for themselves or their parents. She was a blue-eyed, intelligent girl—one who had made her first communion two years previously, and approached the Holy Sacrament manchmal—many times, she said, during the course of the year. As time went on, experience taught us that the children of the Rigi are one of its most distinctive characteristics. Intelligent, bright- countenanced, and yet modest, they are the most attractive race of juveniles to be met with in Switzerland, and, as yet, are unspoiled by contact with the stranger crowd. They form the most remarkable contrast to those of the Bernese Oberland, where the grandeur of Grindelwald and other spots is so much marred by the swarms of sickly beggar-children that there flock round one from all quarters. Here, on the contrary, they are brimful of health and intelligence, and never once during all our wanderings in the forest cantons did a beggar, old or young, ever cross our path. So much for the popular fallacy, or rather calumny, which says that prosperity, comfort, and thrift are alone to be found in the Protestant cantons, and that beggary, want, and uncleanliness mark the entrance into the Catholic districts. Like many such sayings, it does not bear investigation; but when even the most just-minded start on their travels with prejudiced minds, it is astonishing how readily they accept the opinions of men whose want of observation they despise at home. Above all, should the question be anything concerning Catholicity, their wilful blindness surpasses all belief. Some exceptions to this rule there certainly are, increasing, too, each year,
  • 31. like the celebrated Dr. Arnold, for instance, who frankly admitted that he had found nothing in Switzerland to justify such a verdict being passed on its Catholic population, and was generous enough to acknowledge this. Nor are the children who cover the Rigi, selling fruit and flowers, idlers in any way. The law requires their attendance at school up to the age of eight all the year round, but from eight to twelve only during the winter months. This arrangement has been made in order that they may accompany their parents to the upland châlets, or, as often happens, mind the cattle alone on the higher pastures. A most interesting class they are, and one must ardently pray that nothing may ever change or modernize them, according to the present ideas of so-called “civilization”! For several days we took up our abode at Kaltbad, and never had cause for one moment's regret. The hotel is in itself a marvel of material comfort and luxury at such an altitude; the air brisk, invigorating, and yet balmy, and the views simply lovely. Who can forget the terrace facing the Uri-Rothstock, [pg 398] Tittlis, and many another peak and pass, and overhanging Vitznau, whence we could even distinguish my favorite red standard floating over its hotel, as the steamers came and went to Lucerne or Fluelen, and the light smoke of the engines told that the trains were creeping up towards us? Sometimes, it is true, the lake and all below were hidden by the clouds that settled in thick masses over the water or floated beneath us in light, vapory forms, while the heights and summits opposite shone, like Kaltbad, in brilliant sunlight; making us more fully realize the great elevation we were inhabiting in such tranquillity. Then, the mornings spent in the “Wilderness,” which is represented nowadays by fir-trees, descendants of those the three sisters knew, but at present embedded in velvety turf on the hillside, with seats and tables carefully placed at the best points of view! And the dear little church to turn into at all times and hours, with the lamp ever
  • 32. burning, and never quite empty! The afternoons we devoted to longer excursions, ascents and descents in all directions. That to the Kulm, or Summit, was made by rail, despite its terrors and perils. The young people insisted on our making the experiment, but they could not succeed in persuading us elders to return, except on foot! The Kaltbad world seems to go through the ordeal unconcernedly; but nervous and uncomfortable work it must always be, no matter how custom may familiarize them with it. One spot especially is most alarming, where the precipice seems to go straight down from the railroad to the plain many thousand feet below. As a matter of course, the sunset at the Kulm is the great event on the Rigi—one, however, which altogether depends upon the weather. We were most fortunate in catching a clear atmosphere, and consequently distinct horizon. Then, sleeping at the large hotel at the top, we included the famed sunrise in the same excursion. Oh! for the pen of poet to describe either of these sights properly. They are among those grand scenes which nature holds so completely in her own keeping that no rush of commonplace humanity can ever lower or vulgarize them. Crowds from all countries were present, yet we saw nothing save the glorious panorama before us—the sun sinking grandly behind the Jura Mountains in the west, or rising majestically from behind the Sentis far away in Appenzell, after having first heralded his approach by coloring with the light touch of “rosy- fingered morn” the Finster-Aarhorn, Wetterhorn, Monk, and Jungfrau, as they stand in gradual succession, facing the east, in the Bernese Oberland. Here, too, were all the scenes of that famous Swiss history which we had been studying within the last few days—the town of Schwytz in the Urschweiz, bright and cheerful on its fresh, green meadows; Lomerz, where Stauffacher commenced the great revolution; the small lake of Egeri, the site of the battle of Morgarten; Kappel, on this side of the Zurich line of hills—the Albis—with its monument to Zwingle, who was killed here in battle against the Schwytzers; Königsfelden, further north, the scene of Albrecht's murder, and, later, the site of the sanguinary Agnes' convent; Küssnacht at our
  • 33. feet, with Tell's Chapel close by, the object of my guide's pilgrimages, and where the fatal arrow is said to have entered Gessler's heart; the [pg 399] Lake of Sempach, and Lucerne towards the northwest—every spot, in short, hallowed by some memory sacred to Swiss patriotism or piety. A circumference of three hundred miles is said to be included in this panorama, dotted here and there with thirteen lakes, distinguishable in clear weather. But it needs a mountaineer's eye to detect this number, for, though they certainly do exist, as proved by the map, even the youthful sight of George C—— and his sister failed to count more than eleven. The other two had “to be taken on trust,” on the word of the guides, who declared that particular gleams of sunlight rested on distant waters. But it is not the number of lakes or the extent of view which gives such renown to this favorite spot. It is the grand poetry of its nature, the interest of its associations, and that great, indescribable influence which the poet addresses as “Spirit of Beauty, that dost consecrate With thine own hues all thou dost shine upon.” Amongst the pleasantest of many pleasant memories, that of Sunday at Kaltbad stands forth pre-eminent. The weather was brilliant, and high and low appeared in corresponding costume. It cannot be said that in the hotel proper the day was altogether sanctified or edifying; for, except the Catholics, the English Protestants, and a rare few others, the foreigners show little outward sign of remembering the day. Indeed, one lady ingenuously confessed her surprise that we should be so careful about attending church, considering that she never thought of it whilst “taking the waters,” as she liked to fancy she was doing at Kaltbad. “Who did?” she asked; and certainly it looked as if the majority were of her way of thinking. Not the peasants, however, and let us hope that their example may yet influence the strangers. Alas! alas! how one trembles, lest the reverse may be the result of this inroad of
  • 34. “civilized” multitudes to their midst! But so far no harm seems to have come of the contact. As the hour for Mass drew near, men and women were to be seen coming from various points, and when we reached the church it was so full that a large overflow of the congregation had taken up their position in the little porch outside. It seemed as though the history of the past century would repeat itself over again; that a new church would become necessary, and another new tablet be put up, telling future generations that the present one had “proved insufficient for the number of Alpine inhabitants and pilgrims.” No sight could be prettier, considering the locality, the bright sun, and all these people in their Sunday dress. In the latter particular, however, one peculiarity had a singular effect, namely, that on the Rigi “full dress” for the men seems to consist in the absence of their outer coats, and the Sunday distinction is shown only by the snow-white linen of their shirt-sleeves and collars. All had their alpenstocks and their prayer-books, which they read devoutly during the whole time. Anna and I also remained outside, as there was no room within; but we heard every word distinctly, and could see the altar through the open door and windows. The service began by an oblation of the Mass and the Acts of Faith, Hope, and Charity in German, in the very manner and words used in so many other countries, but notably in all the churches of Ireland. This was followed by a good sermon, in which the preacher chiefly urged the necessity [pg 400] of “keeping holy the Sabbath day,” of living in peace and concord, but likewise of holding fast to the principles of religion, “like their forefathers of old,” of whose virtues and steadfastness he spoke in glowing language. It was the first sermon we had had an opportunity of listening to in these parts, and it was very curious to hear, even in a small out-of-the-way place of this kind, such allusions thus brought in as a matter of course, and so thoroughly in accordance with Herr H——'s predictions. At its termination we were surprised to see half a dozen of the hotel guests rise and leave; but these, we later learnt, were Lutherans, who, having no chaplain of their own, find no difficulty in coming to the preliminary part of the Catholic service, though they consider it their duty to leave before Mass commences. It was a curious
  • 35. instance of liberalism, and of the little essential antagonism German Protestants entertain towards the Catholic Church. At the end of Mass a prayer was said in German in honor of the Five Sacred Wounds, joined in by all, after which the congregation dispersed, some to the front of the hotel, and others in various directions. On these days alone a few picturesque costumes appear, but they are generally from other parts, as the Rigi boasts of nothing special of this kind. To-day two women in bright bodices covered by silver buttons and crosses, and with silvered head-dresses, enlivened the group of women—relations of the clerk coming, they said, to visit this spot from Bürglen, a long distance on the other side of the lake, and beyond Sachslen, the sanctuary of “Bruder Klaus.” Not wishing to disturb our Anglican friends, who were singing hymns and performing their service in one of the drawing-rooms of the house, Anna and I sauntered past the “Wilderness,” until we reached the Käuzli. The atmosphere was most clear, and the landscape so enchanting that a rest here seemed a fitting and heavenly portion of our morning worship. Weggis lay below; its church and the children's corner, where I had stood lately gazing upwards in this direction, were at our feet, and Lucerne, with its girdle of battlemented walls at the upper end of the lake, further north, its houses and boats distinctly visible in the transparent atmosphere. The peasants could be seen here and there returning to their gray-roofed châlets, but, save the tinkling bells of the light-limbed cattle browsing in our neighborhood, no sound broke the perfect stillness of the scene. All at once the peal of Lucerne Cathedral came booming to us across the waters! It was eleven o'clock, which in those cantons is the Angelus hour, and in a moment the deep-toned bell of Weggis sent its sound up to our very resting-place. Then swiftly the echo was caught up by the churches of all the numberless pretty villages that here cover the land, until the whole country seemed to sound as with but one note. A more thrilling instance of faith and practice it were impossible to imagine, and, looking down at such a moment at this fruitful, prosperous district, one felt as if our Lord had already heard its prayers, and in his mercy blessed it.
  • 36. Our afternoon walk was this day directed to the other Rigi sanctuary, “Maria zum Schnee,” or Mary of the Snow, the same mentioned in the Kaltbad tablet, and which, from Wordsworth's beautiful poem, has obtained a more world-wide [pg 401] name than its pretty neighbor; though in the locality itself no difference in celebrity is admitted between the two. The only striking distinction is that whilst Kaltbad has but the one simple appellation, “Mary of the Snow” rejoices in a pet name, by which it is more generally known on the Rigi, where Klösterli, or “the little convent,” is its familiar and every- day title. It lies deep in a southern fold of the mountain, unseen from Kaltbad, but only a couple of miles distant; so that it is a favorite walk with those visitors whose strength is unequal to the longer excursions. This year the charms of the mountain-road have been sadly interfered with by the blasting of rocks necessary to the making of the railway branch to the Scheideck, and another line up from Arth to the Staffel, besides the building of an additional hotel, all which modern material improvements make one look forward with trepidation to their future effect on the old inhabitants. In a few years more these heights will be one vast mountain-city—a new phase of life, which may have its own poetic side, it is true, and bring health and advantage to humanity in general, but which, during two or three months of the year, so completely changes the old character of the beautiful mountain that its friends of twenty and thirty years' standing say they can no longer recognize its former simplicity. Hence our musings were somewhat melancholy, as we wandered on above the new railway-line, until, from a bend in the hill, we unexpectedly came in sight of a completely new scene, the curious Mythen rocks rising above Schwytz, in the distance, and Klösterli itself lying peacefully below us, as if sheltered from all harm in a dell beneath the Kulm! It seemed a spot exactly made for snow, and one could almost fancy it buried at times under the soft embrace of some snow-white drift. Whether the name first came from this circumstance of its position, or from its connection with the Basilica of Santa Maria Maggiore at Rome, we had no opportunity of ascertaining; but, whatever the cause, the name and connection seemed most appropriate. Certain it is that the painting which is the
  • 37. chief ornament of S. Maria zum Schnee is a copy of the one at the great basilica, and, moreover, that the church at Klösterli has been, as is fitting, affiliated to the one in Rome. The festival is kept on the same day, the 5th of August, and the Rigi church was consecrated by a Papal Nuncio in 1700, and endowed since then with many privileges by Pope Clement XII., so that the link in interest and connection has never been wanting. Mr. C—— knew all the particulars, and as we descended the steep pathway to Klösterli he recalled to us the beautiful tradition about the foundation of Santa Maria Maggiore. He reminded us how a Roman senator and his wife having been converted to Christianity, the latter had a dream which made her believe they ought to build a church in honor of the Blessed Virgin. Her husband, however, dismissed the idea as a fancy of her brain, until, having had the same dream for three successive nights, his wife on the last occasion understood that she ought to choose the site which should be covered with snow on the following morning. Her husband, still unwilling, accompanied her in the search, when, not far from the house, they found the top of the Esquiline Mount completely [pg 402] covered with a fine crust of snow! This occurred on the 5th of August, and, bringing conviction to the husband's mind, he at once consented to give up his fortune for the purpose, and built on the spot the Basilica, which now covers the extent of ground marked out by the fall of snow. Another version states that it was the result of a vision which the pope, S. Liberius, and John, the patrician, had on the same night, and which was confirmed the following morning, the 5th of August, by a miraculous fall of snow, which extended over the space the church was to occupy. Certain it is that the fall of snow occurred, on this very spot too, and that the recollection of this wonderful origin is still kept alive in Rome. On the Feast of Santa Maria ad Nives, on the 5th of the hot month of August, a shower of white leaves is made to fall on the congregation attending High Mass at the great Basilica. What affiliation, therefore, could be more fitting for a mountain chapel? With renewed interest we hurried to the spot. The village consists entirely of a few inns, the convent—where live the Capuchin fathers who have care of the church—and of the church itself, much larger
  • 38. than that at Kaltbad, and which forms the centre of the whole place. The old character is maintained up to the present time, these inns being still most homely—very different from the luxurious abodes elsewhere on the mountain—and the convent in reality an hospice for pilgrims, which at once gives the impression of a higher aim than mere pleasure-seeking. The Capuchin fathers, who glide about with serious mien in their brown habits, add to the solemnity, further increased by the depth of the valley “making sunset,” as the sailors say, to the place long before it happens on the surrounding heights. It has nothing cheerful or peculiarly attractive to the general public, so one might hope that it would escape the contagion of a worldly spirit. This year the gloom has been added to by a dreadful accident connected with the unwelcome railway, and one heard of little else on the spot. A young lady who was sitting with her father outside the Sonne Hotel, writing at one of the small tables, was suddenly struck by a large stone, thrown by the blasting of a rock close by, and died in less than half an hour. She was to have gone away from Klösterli on the previous day with the rest of her family, but had remained a while longer merely to take care of him. His grief, consequently, was overwhelming. It was a melancholy inauguration of the “iron road,” and for the moment made a deep impression on all concerned. But it is much to be dreaded that it will not be a lasting one. The father, to whom we spoke, shook his head gravely, as he pointed to the railway works, expressing his fears that from a place of pilgrimage they would soon convert his dearly-loved Klösterli into a simple Curort, or, in modern parlance, a Sanatorium. He complained of its baneful influence already; for, though the peasants are thoroughly good and pious, the immense influx of tourists gives them little time for devotions during the summer season, especially in the month of August, when the church festival occurs. They, the monks, belong to the large Capuchin convent at Arth, from which two or three have been sent here at the special request of the commune, ever since the foundation, to take care of this church and attend to [pg 403] the wants of the pilgrims. But the numbers of the latter are diminishing from the above causes, and hospitality has this year been chiefly bestowed on invalid priests,
  • 39. who here seek change of air for weeks at a time. The procession similar to that from Weggis, which used to come up from Arth for the 5th of August, making the Stations on the way, did not take place this time. Nor had the people leisure, either, for their old games, which followed the church services as a matter of course. Sad and melancholy, he seemed fearful of this inroad of materialism and the many temptations to which the poorer classes may be exposed. The tranquillity of the spot will doubtless be ruined by the puffing engine and obtrusive railway, and we could not but rejoice doubly that the “haven of rest” at Kaltbad lies safely hidden away behind its rocks out of reach of such disturbance. But so many have been the prayers answered and hearts cured within the last two centuries by the intercession of holy “Mary of the Snow” that it is hard to believe so favored a sanctuary, though this may perhaps be a moment of transition, will be altogether swept away or lose its holy influence on so essentially pious a population. The church is crowded with ex-votos, many of them the same seen by Wordsworth in 1820, when he sang in the following strain of “Our Lady Of The Snow. “Meek Virgin Mother, more benign Than fairest star upon the height Of thy own mountain set to keep Lone vigils thro' the hours of sleep, What eye can look upon thy shrine Untroubled at the sight? “These crowded offerings, as they hang In sign of misery relieved, Even these, without intent of theirs, Report of comfortless despairs, Of many a deep and cureless pang And confidence deceived. “To thee, in this aërial cleft.
  • 40. As to a common centre, tend All sufferings that no longer rest On mortal succor, all distrest That pine of human hope bereft, Nor wish for earthly friend. “And hence, O Virgin Mother mild! Though plenteous flowers around thee blow, Not only from the dreary strife Of winter, but the storms of life, Thee have thy votaries aptly styled Our Lady of the Snow. “Even for the man who stops not here, But down the irriguous valley hies, Thy very name, O Lady! flings, O'er blooming fields and gushing springs, A holy shadow soft and dear Of chastening sympathies! “Nor falls that intermingling shade To summer gladsomeness unkind; It chastens only to requite With gleams of fresher, purer light; While o'er the flower-enamelled glade More sweetly breathes the wind. “But on!—a tempting downward way, A verdant path, before us lies; Clear shines the glorious sun above; Then give free course to joy and love, Deeming the evil of the day Sufficient for the wise.” In our walk hither along the brow of the hill we had talked to some pretty, bright-eyed children running about to call in their father's
  • 41. cattle, asking their names and other questions; but, returning the same way, all our thoughts and attention were given to the distant sound of avalanches, which the C——s declared came to us across the mountain-tops from the region of the great Oberland range. Anything more sublime it were difficult to conceive in the fading light and soft hues of the sunset twilight. We had quite forgotten the children, but they had been thinking of us, and, passing on by their châlet, little Aloysius (a fair-haired boy of three years old) was seen skipping down the green slope with a paper in his hand. It was a mysterious proceeding, especially when he came and eagerly presented it to me. But my surprise was greater on reading it to find that it consisted of prayers printed at Einsiedeln: the first teaching how to offer up one's intention with the Masses that [pg 404] are being said all over the world; another to be said when present during the offertory of the Mass; and a third, when unable to attend in person, for daily recital at home in union with the priest at the altar. The little fellow evidently prized it, as taught by his mother, and it was fortunate that I was able to promise him it should hold a place amongst my treasures, and that I would say the beautiful prayers daily, which I have never failed to do. But he could not altogether know how much happiness his act caused me, chasing away the gloomy fears of the Capuchin father, and giving bright hope that a true spirit of piety will grow up with the rising generation.
  • 43. Church Song. “And when they had said an hymn, they went forth to the Mount of Olives.”—S. Mark xiv. 26. “Hymnum cecinit, ut et nos similiter faciamus.”—S. Chrysostom. The Disciple. A world I'd give to hear thee sing That song! Too long Is life until it bring The breaking of the bonds that cling About this deadly flesh. Sweet Lord, refresh My weary, longing soul; And this sad banishment condole With one faint echo of that strain Of melody divine, which must remain Yet murmuring through space Of all creation's bound; And so controls The harmony that rolls In floods of majesty and grace Throughout thy dwelling-place, From tuneful lyres Of angel choirs, From ceaseless rapturous songs Of shining saintly throngs,
  • 44. That every sound Heaven hears doth merely seem Made to accompany thy theme. Wondrous Singer, O my Lord and King! Tell me, who taught thee how to sing So sweet a strain? [pg 405] The Master. I heard my Mother's voice one morn, Whilst yet in womb unborn, Chanting the canticle of praise She still in heaven doth raise; And when a boy, oft at her knee, She did the tuneful mystery Unfold to me. Wouldst hear me sing? 'Tis no hard thing. Go, hearken to the singing of my Bride With whom my Presence ever doth abide; Who is a Mother unto thee, Like as the Virgin, full of grace, to me. Her voice, in melody her own, If thou wilt mark its heavenly tone, Hath cunning art To make thy heart Hear mine again.
  • 46. A Discussion With An Infidel. XVIII. Personal Continuance. Reader. The next question you treat, doctor, regards the immortality of the human soul, or, as you call it, “personal continuance.” In your opinion the spirit and the body, the soul and the brain, are so intimately and inseparably connected that a soul without a body, as “force without matter,” can never exist. I remember having already answered some of the grounds of this opinion; but as you make “personal continuance” the subject of a special chapter, I presume that it is in this chapter that you have condensed the strength and substance of all your arguments. How do you, then, establish your position? Büchner. “A spirit without a body is as unimaginable as electricity or magnetism without metallic or other substances” (p. 196). Reader. Unimaginable! Of course, a spiritual substance is not the object of imagination. Perhaps you mean that it is unthinkable, inconceivable, or unintelligible; which I deny. Büchner. “Unprejudiced philosophy is compelled to reject the idea of an individual immortality and of a personal continuance after death. With the decay and dissolution of its material substratum, through which alone it has acquired a conscious existence and become a person, and upon which it was dependent, the spirit must cease to exist” (ibid.) Reader. Beware of fallacies, doctor. You have not yet proved that the human soul needs a material substratum. Again, you merely assume
  • 47. that it is through the body [pg 406] that the soul has acquired a conscious existence, whilst the fact is that the soul through itself is conscious of its own existence in the body. Moreover, the soul does not become a person through the body it informs, but, on the contrary, confers on the body the privilege of being a part of the person. Lastly, the spirit is not dependent upon the body, except for the sensitive operations; and you cannot assume that the soul depends upon the body for its own being. Hence your conclusion is yet unproved. Büchner. “All the knowledge which this spirit has acquired relates to earthly things; it has become conscious of itself in, with, and by these things; it has become a person by its being opposed against earthly, limited individualities. How can we imagine it to be possible that, torn away from these necessary conditions, this being should continue to exist with self-consciousness and as the same person? It is not reflection, but obstinacy, not science, but faith, which supports the idea of a personal continuance” (pp. 196, 197). Reader. I am rather amused than embarrassed at your identifying reflection with science and obstinacy with faith, as I know that you are absolutely incapable of accounting for such a nonsensical ranting. It is not true that “all the knowledge acquired by our soul relates to earthly things.” We have already discussed this point, and shown that our knowledge of earthly things is only the alphabet of human knowledge. Nor is it true that our soul “has become conscious of itself by such things.” Consciousness is, even objectively, an immanent act, and the soul cannot be conscious of its own self, except by looking upon itself. No one can say I perceive without a knowledge of the I; and therefore the soul knows its own self independently of the perception of other earthly things. But, as there are philosophers who account for self-consciousness by the primitive accidental sensations experienced by the child, I will suppose with you that our soul becomes conscious of its own existence by means of such sensations. Does it follow from this that the union with the body is “a necessary condition” for the existence
  • 48. 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! ebookultra.com