100% found this document useful (2 votes)
36 views

Mastering C 2nd Edition Venugopal pdf download

The document provides information on downloading the 'Mastering C 2nd Edition' by Venugopal, including links to various other related ebooks and textbooks. It contains details about the book such as its ISBN, file size, publication year, and a brief overview of its content structure. The document also includes a table of contents outlining the chapters and topics covered in the book.

Uploaded by

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

Mastering C 2nd Edition Venugopal pdf download

The document provides information on downloading the 'Mastering C 2nd Edition' by Venugopal, including links to various other related ebooks and textbooks. It contains details about the book such as its ISBN, file size, publication year, and a brief overview of its content structure. The document also includes a table of contents outlining the chapters and topics covered in the book.

Uploaded by

aartsrowida
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Mastering C 2nd Edition Venugopal pdf download

https://ebookfinal.com/download/mastering-c-2nd-edition-
venugopal/

Explore and download more ebooks or textbooks


at ebookfinal.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookfinal.com
for more options!.

Mastering C Database Programming 1st Edition Jason Price

https://ebookfinal.com/download/mastering-c-database-programming-1st-
edition-jason-price/

Mastering Windows SharePoint Services 3 1 C. A. Callahan

https://ebookfinal.com/download/mastering-windows-sharepoint-
services-3-1-c-a-callahan/

Mastering Leadership 2nd Edition Michael Williams

https://ebookfinal.com/download/mastering-leadership-2nd-edition-
michael-williams/

Mastering Linux 2nd Edition Arman Danesh

https://ebookfinal.com/download/mastering-linux-2nd-edition-arman-
danesh/
Mastering Metasploit 2nd Edition Nipun Jaswal

https://ebookfinal.com/download/mastering-metasploit-2nd-edition-
nipun-jaswal/

Mastering Blender 2nd edition Edition Tony Mullen

https://ebookfinal.com/download/mastering-blender-2nd-edition-edition-
tony-mullen/

Ceramics Mastering the Craft 2nd Edition Richard Zakin

https://ebookfinal.com/download/ceramics-mastering-the-craft-2nd-
edition-richard-zakin/

XSLT mastering XML transformations 2nd Edition Doug


Tidwell

https://ebookfinal.com/download/xslt-mastering-xml-
transformations-2nd-edition-doug-tidwell/

Mastering Regular Expressions 2nd Edition Edition Jeffrey


E. F. Friedl

https://ebookfinal.com/download/mastering-regular-expressions-2nd-
edition-edition-jeffrey-e-f-friedl/
Mastering C 2nd Edition Venugopal Digital Instant
Download
Author(s): Venugopal
ISBN(s): 9781259029943, 1259029948
Edition: 2
File Details: PDF, 8.10 MB
Year: 2013
Language: english
Mastering C++
Mastering C++

K R VENUGOPAL
University Visvesvaraya College of Engineering
Bangalore University, Bangalore
India

RAJKUMAR BUYYA
The University of Melbourne and Manjrasoft Pvt. Ltd.,
Melbourne, Australia

McGraw Hill Education (India) Private Limited


NEW DELHI

McGraw Hill Education Offices


New Delhi New York St Louis San Francisco Auckland Bogotá Caracas
Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal
San Juan Santiago Singapore Sydney Tokyo Toronto
McGraw Hill Education (India) Private Limited

Published by McGraw Hill Education (India) Private Limited


P-24, Green Park Extension, New Delhi 110016

Mastering C++, 2e
Copyright © 2013, 1999, by McGraw Hill Education (India) Private Limited.
No part of this publication can be reproduced or distributed in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written
permission of the publishers. The program listings (if any) may be entered, stored and executed in a computer
system, but they may not be reproduced for publication.

This edition can be exported from India only by the publishers,


McGraw Hill Education (India) Private Limited

ISBN (13) : 978-1-25902994-3


ISBN (10) : 1-25-902994-8

Vice President and Managing Director: Ajay Shukla


Head—Higher Education (Publishing and Marketing): Vibha Mahajan
Publishing Manager (SEM & Tech. Ed.): Shalini Jha
Assistant Sponsoring Editor: Smruti Snigdha
Editorial Researcher: Amiya Mahapatra
Manager—Production Systems: Satinder S Baveja
Assistant Manager—Editorial Services: Sohini Mukherjee
Production Executive: Anuj K Shriwastava
Assistant General Manager (Marketing)—Higher Education: Vijay Sarathi
Senior Product Specialist: Tina Jajoriya
Senior Graphic Designer—Cover: Meenu Raghav
General Manager—Production: Rajender P Ghansela
Manager—Production: Reji Kumar

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

Cover Printer :
Dedicated
to
Tejaswi Venugopal
Contents
Foreword xvii
Preface xix
Acknowledgements xxiii

1. Object-Oriented Paradigm 1
1.1 Why New Programming Paradigms ? 1
1.2 OOPs ! a New Paradigm 2
1.3 Evolution of Programming Paradigms 5
1.4 Structured Versus Object-Oriented Development 8
1.5 Elements of Object-Oriented Programming 10
1.6 Objects 11
1.7 Classes 12
1.8 Multiple Views of the Same Object 13
1.9 Encapsulation and Data Abstraction 15
1.10 Inheritance 15
1.11 Delegation—Object Composition 17
1.12 Polymorphism 17
1.13 Message Communication 18
1.14 Popular OOP Languages 19
1.15 Merits and Demerits of OO Methodology 23
1.16 OO Learning Curve 24
1.17 Software Reuse 25
1.18 Objects Hold the Key 28
Review Questions 29

2. Moving from C to C++ 31


2.1 Introduction 31
2.2 Hello World 31
2.3 Streams Based I/O 35
2.4 Single-Line Comment 39
2.5 Literals—Constant Qualifiers 42
2.6 Scope-Resolution Operator:: 44
2.7 Variable Definition at the Point of Use 46
2.8 Variable Aliases—Reference Variables 47
2.9 Strict Type Checking 49
2.10 Parameters Passing by Reference 51
viii Contents

2.11 Inline Functions 54


2.12 Function Overloading 55
2.13 Default Arguments 58
2.14 Keyword typedef 60
2.15 Functions as a Part of a struct 61
2.16 Type Conversion 64
2.17 Function Templates 65
2.18 Runtime Memory Management 69
Solved Problem 73
Review Questions 74

3. C++ at a Glance 76
3.1 Introduction 76
3.2 Data Encapsulation and Abstraction—Classes 77
3.3 Inheritance–Derived Classes 81
3.4 Polymorphism—Operator Overloading 85
3.5 friend Functions 88
3.6 Polymorphism—Virtual Functions 91
3.7 Generic Classes—Class Templates 94
3.8 Exception Handling 96
3.9 Streams Computation 99
Solved Problem 103
Review Questions 104

4. Data Types, Operators and Expressions 105


4.1 Introduction 105
4.2 Character Set 105
4.3 Tokens, Identifiers, and Keywords 105
4.4 Variables 107
4.5 Data Types and Sizes 108
4.6 Variable Definition 109
4.7 Variable Initialization 110
4.8 Characters and Character Strings 112
4.9 Operators and Expressions 113
4.10 Qualifiers 115
4.11 Arithmetic Operators 118
4.12 Relational Operators 121
4.13 Logical Operators 124
4.14 Bitwise Operators 126
4.15 Compound Assignment Operators 130
4.16 Increment and Decrement Operators 131
Contents ix

4.17 Conditional Operator (Ternary Operator) 132


4.18 Special Operators 134
4.19 typedef Statement 134
4.20 Promotion and Type Conversion 135
4.21 Constants 137
4.22 Declaring Symbolic Constants—Literals 140
4.23 Enumerated Data Types 142
4.24 Macro Functions 145
4.25 Operator Precedence and Associativity 147
Solved Problem 150
Review Questions 150

5. Control Flow 152


5.1 Introduction 152
5.2 Statements and Block 153
5.3 if Statement 153
5.4 if-else Statement 155
5.5 Nested if-else Statements 157
5.6 for Loop 159
5.7 while Loop 163
5.8 do..while Loop 166
5.9 break Statement 168
5.10 switch Statement 170
5.11 continue Statement 173
5.12 goto Statement 175
5.13 Wild Statements 176
Solved Problem 178
Review Questions 179

6. Arrays and Strings 181


6.1 Introduction 181
6.2 Operations on Arrays 181
6.3 Array Illustrations 187
6.4 Multidimensional Arrays 192
6.5 Strings 195
6.6 String Manipulations 197
6.7 Arrays of Strings 200
6.8 Evaluation Order/Undefined Behaviors 203
Solved Problem 204
Review Questions 205
x Contents

7. Modular Programming with Functions 207


7.1 Introduction 207
7.2 Function Components 210
7.3 Passing Data to Functions 214
7.4 Function Return Data Type 218
7.5 Library Functions 219
7.6 Parameter Passing 221
7.7 Return by Reference 226
7.8 Default Arguments 227
7.9 Inline Functions 230
7.10 Function Overloading 231
7.11 Function Templates 236
7.12 Arrays and Functions 237
7.13 C++ Stack 239
7.14 Scope and Extent of Variables 240
7.15 Storage Classes 243
7.16 Functions with Variable Number of Arguments 246
7.17 Recursive Functions 249
7.18 Complete Syntax of main( ) 252
Solved Problem 254
Review Questions 255

8. Structures and Unions 257


8.1 Introduction 257
8.2 Structure Declaration 257
8.3 Structure Definition 258
8.4 Accessing Structure Members 260
8.5 Structure Initialization 261
8.6 Nesting of Structures 262
8.7 Array of Structures 265
8.8 Structures and Functions 270
8.9 Data-Type Enhancement Using typedef 275
8.10 Structures and Encapsulation 277
8.11 Unions 281
8.12 Differences between Structures and Unions 284
8.13 Bit Fields in Structures 287
Review Questions 290

9. Pointers and Runtime Binding 291


9.1 Introduction 291
9.2 Pointers and their Binding 292
Contents xi

9.3 Address Operator & 293


9.4 Pointer Variables 294
9.5 Void Pointers 300
9.6 Pointer Arithmetic 301
9.7 Runtime Memory Management 304
9.8 Pointers to Pointers 306
9.9 Array of Pointers 308
9.10 Dynamic Multi-Dimensional Arrays 312
9.11 Pointer Constants 317
9.12 Pointers and String Functions 318
9.13 Environment Specific Issues 319
9.14 Pointers to Functions 321
9.15 Pointers to Constant Objects 325
9.16 Constant Pointers 326
9.17 Pointer to Structures 326
9.18 Wild Pointers 331
Solved Problems 335
Review Questions 336

10. Classes and Objects 339


10.1 Introduction 339
10.2 Class Specification 340
10.3 Class Objects 342
10.4 Accessing Class Members 343
10.5 Defining Member Functions 348
10.6 Outside Member Functions as inline 351
10.7 Accessing Member Functions within the Class 354
10.8 Data Hiding 355
10.9 Access Boundary of Objects Revisited 359
10.10 Empty Classes 360
10.11 Pointers within a Class 361
10.12 Passing Objects as Arguments 362
10.13 Returning Objects from Functions 367
10.14 Friend Functions and Friend Classes 368
10.15 Constant Parameters and Member Functions 376
10.16 Structures and Classes 380
10.17 Static Data and Member Functions 381
10.18 Class, Objects, and Memory Resources 386
10.19 Class-Design Steps 388
Solved Problem 389
Review Questions 390
xii Contents

11. Object Initialization and Clean-up 392


11.1 Class Revisited 392
11.2 Constructors 394
11.3 Parameterized Constructors 397
11.4 Destructor 400
11.5 Constructor Overloading 402
11.6 Order of Construction and Destruction 405
11.7 Constructors with Default Arguments 407
11.8 Nameless Objects
11.9 Dynamic Initialization through Constructors 411
11.10 Constructors with Dynamic Operations 413
11.11 Copy Constructor 414
11.12 Constructors for Two-dimensional Arrays 417
11.13 Constant Objects and Constructor 422
11.14 Static Data Members with Constructors and Destructors 425
11.15 Nested Classes 427
Solved Problems 428
Review Questions 431

12. Dynamic Objects 433


12.1 Introduction 433
12.2 Pointers to Objects 434
12.3 Live Objects 441
12.4 Array of Objects 444
12.5 Array of Pointers to Objects 447
12.6 Pointers to Object Members 449
12.7 Function set_new_handler( ) 455
12.8 this Pointer 456
12.9 Self-Referential Classes 458
12.10 Guidelines for Passing Object Parameters 465
Solved Problems 466
Review Questions 467

13. Operator Overloading 468


13.1 Introduction 468
13.2 Overloadable Operators 469
13.3 Unary Operator Overloading 470
13.4 operator Keyword 472
13.5 Operator Return Values 474
13.6 Nameless Temporary Objects 476
13.7 Limitations of Increment/Decrement Operators 477
Contents xiii

13.8 Binary Operator Overloading 482


13.9 Arithmetic Operators 483
13.10 Concatenation of Strings 489
13.11 Comparison Operators 491
13.12 Arithmetic Assignment Operators 495
13.13 Overloading of new and delete Operators 499
13.14 Data Conversion 502
13.15 Conversion between Basic Data Types 502
13.16 Conversion between Objects and Basic Types 503
13.17 Conversion between Objects of Different Classes 508
13.18 Subscript Operator Overloading 516
13.19 Overloading with Friend Functions 518
13.20 Assignment Operator Overloading 527
13.21 Tracing Memory Leaks 530
13.22 Niceties of Operator Overloading and Conversions 533
Solved Problems 537
Review Questions 539

14. Inheritance 541


14.1 Introduction 541
14.2 Class Revisited 542
14.3 Derived Class Declaration 546
14.4 Forms of Inheritance 552
14.5 Inheritance and Member Accessibility 553
14.6 Constructors in Derived Classes 558
14.7 Destructors in Derived Classes 566
14.8 Constructor Invocation and Data-Member Initialization 567
14.9 Overloaded Member Functions 570
14.10 Abstract Classes 575
14.11 Multilevel Inheritance 576
14.12 Multiple Inheritance 579
14.13 Hierarchical Inheritance 590
14.14 Multipath Inheritance and Virtual Base Classes 594
14.15 Hybrid Inheritance 600
14.16 Object Composition—Delegation 604
14.17 When to Use Inheritance? 609
14.18 Benefits of Inheritance 610
14.19 Cost of Inheritance 610
Solved Problems 611
Review Questions 614
xiv Contents

15. Virtual Functions 617


15.1 Introduction 617
15.2 Need for Virtual Functions 618
15.3 Pointer to Derived Class Objects 621
15.4 Definition of Virtual Functions 625
15.5 Array of Pointers to Base-Class Objects 628
15.6 Pure Virtual Functions 631
15.7 Abstract Classes 634
15.8 Virtual Destructors 637
15.9 How is Dynamic Binding Achieved ? 640
15.10 Rules for Virtual Functions 643
Solved Problems 643
Review Questions 644

16. Generic Programming with Templates 647


16.1 Introduction 647
16.2 Function Templates 647
16.3 Overloaded Function Templates 656
16.4 Nesting of Function Calls 658
16.5 Multiple Arguments Function Template 659
16.6 User-Defined Template Arguments 661
16.7 Class Templates 662
16.8 Inheritance of Class Template 668
16.9 Class Template Containership 673
16.10 Class Template with Overloaded Operators 678
Solved Problems 680
Review Questions 682

17. Streams Computation with Console 684


17.1 What are Streams ? 684
17.2 Predefined Console Streams 686
17.3 Hierarchy of Console Stream Classes 689
17.4 Unformatted I/O Operations 691
17.5 Formatted Console I/O Operations 696
17.6 Manipulators 705
17.7 Custom/User-Defined Manipulators 712
17.8 Stream Operators with User-Defined Classes 717
Solved Problems 719
Review Questions 720

18. Streams Computation with Files 722


18.1 Introduction 722
Contents xv

18.2 Hierarchy of File Stream Classes 723


18.3 Opening and Closing of Files 725
18.4 Testing for Errors 731
18.5 File Modes 736
18.6 File Pointers and their Manipulations 737
18.7 Sequential Access to a File 741
18.8 ASCII and Binary Files 742
18.9 Saving and Retrieving of Objects 744
18.10 File Input/Output with fstream Class 747
18.11 Random Access to a File 750
18.12 In-Memory Buffers and Data Formatting 755
18.13 Error Handling During File Manipulations 756
18.14 Filter Utilities 759
Solved Problem 762
Review Questions 763

19. Exception Handling 765


19.1 Introduction 765
19.2 Error Handling 766
19.3 Exception-Handling Model 766
19.4 Exception-Handling Constructs 767
19.5 Handler Throwing the Same Exception Again 773
19.6 List of Exceptions 775
19.7 Catch All Exceptions 779
19.8 Exceptions in Constructors and Destructors 781
19.9 Handling Uncaught Exceptions 784
19.10 Exceptions in Operator Overloaded Functions 789
19.11 Exceptions in Inheritance Tree 792
19.12 Exceptions in Class Templates 794
19.13 Fault-Tolerant Design Techniques 799
19.14 Case-Study on Software Fault Tolerance 800
19.15 Memory Allocation Failure Exception 804
19.16 Ten Rules for Handling Exceptions Successfully 806
Solved Problems 812
Review Questions 814

20. OO Analysis, Design and Development 815


20.1 Software Life Cycle: Waterfall Model 816
20.2 Cost of Error Correction 818
20.3 Change Management 819
20.4 Reusable Components 820
20.5 Software Life Cycle: Fountain-Flow Model 822
xvi Contents

20.6 Object-Oriented Notations 823


20.7 Object-Oriented Methodologies 823
20.8 Coad and Yourdon Object-Oriented Analysis 826
20.9 Booch’s Object-Oriented Design 827
20.10 Class Design 827
20.11 How to Build Reliable Code? 830
20.12 OO Software Performance Tuning 832
20.13 Software Project Management 833
20.14 Plan for OO Battle 834
20.15 A Final Word 835
Review Questions 836

Appendix A: C++ Keywords and Operators 837


Appendix B: New Features of ANSIC++ Standard 857
Appendix C: C++ Library Function 862
Appendix D: Glossary 866
Appendix E: ASCII Character Set 871
Appendix F: Bibliography 876

Index 878
Foreword
Object-oriented programming languages are playing an increasingly important role in computing sci-
ence and its applications. With the declining hardware costs, the cost of computing systems is now being
largely dominated by software. As new methodologies are being developed, some old ones are slowly
turning obsolete by the end of the day. Sometimes this results in considerable increase in development
cost plus time overrun and affects the quality of products. Object-oriented analysis and design is an
upcoming technology that software professionals have employed successfully in the development of
large software projects.
Programming, as every practitioner knows, is a delicate art, where the main problem is not only to
obtain a working program (which is mandatory of course), but to have a program designed in such a
way that it is not fragile, i.e., it can be modified/updated/debugged easily. In order to attain these goals,
programmers need tools.
Among the tools that allow a programmer to express ideas are, of course, the programming lan-
guages. One such programming language used popularly these days is the C++ language. This book by
K R Venugopal and Rajkumar Buyya is a timely and relevant publication.
This book is unique in many ways. The concepts such as programming paradigms, the need for
OOP technology, extending C, C++ at a glance, fundamental constructs of the C++ language, classes
and objects, inheritance, polymorphism, generic programming, stream computations, fault-tolerant
programming with exceptions are covered prominently. Every aspect is prominently illustrated with
figures and examples that are well tested, illustrative and have impressively designed solutions. The
authors, with their rich industrial and academic experience in Computer Science, have made their best
effort to bring out this book for the benefit of students, teachers, and software professionals.
This book, besides being illustrative, includes a wide array of typical programs, which help OOP
aspirants to grasp the fundamentals of the subject without external assistance. I am confident that this
book will serve the needs of all those who are serious about object-oriented technology.
In this book, the approach followed by the authors make the exploration of the OOP territory as easy
and interesting as possible, starting slowly and working up gradually to more challenging concepts. I
am positive that the reader will find the book an appealing vehicle for embarking into the challenging
world of Mastering C++. Good luck!

S Sasi Kumar
Director
Centre for Development of Advanced Computing
(A Scientific Society of Government of India)
Brunton Road, Bangalore 560 025
Karnataka, India
Preface
In the real world, everything (including you and me!) exist in the form of objects. These objects are
identified by the system analyst upon request of a customer (who actually uses services of objects)
and handed over to the designer. The designer in turn creates classes. which group all those objects
exhibiting similar characteristics and behaviors into a single unit. These units are then passed to
programmers, who implement the object’s framework given by the designer. Thus, objects move from
the customer to the programmer.
Programmers create objects using its framework. These objects work in a collaborative and cooperative
manner to produce the required output. These software objects now start moving from programmers
to test engineers, and finally to the customer, who is the actual user of these objects, to solve real-
world problems. To realize this effective migration of objects from one person to another, there must
be an effective means of communication among all those involved in the development of a software
project. They need to communicate their ideas in terms of objects. That is, the system analyst delivers
requirement specification in terms of objects, and the software designer delivers design specification
in terms of classes (object groups). And even programmers need to express their ideas or write code in
terms of objects. Hence, the demand for an object-oriented requirement specification (OORS), object-
oriented analysis (OOA), object-oriented design (OOD), and object-oriented programming (OOP) has
grown tremendously.
Currently, there is no standard method of OORS, OOA, and OOD available. But, there are many
standard programming languages available that support OOP, and one of the most popular OOP
languages is C++.
C++ is an object-oriented language that a C programmer can appreciate, especially who is an early-
age assembly-language programmer. C++ was first oriented towards execution performance and then
towards flexibility. Most of the features which C++ adds to C involve no runtime overhead; few that do
can be avoided by efficiency-conscious programmers.
Yet, C being a structured programming language, offered the ease of software development but
failed to support maintenance of large code. This has motivated the search for a new language as
efficient as C but simplifying the maintenance of large code. It is not enough to offer a language that
is just as good as C. If people are to switch, the replacement language must not only equal C in terms
of efficiency and code reuse, but it must also be a lot better in terms of productivity, maintenance, and
power. C++ meets these criteria, making it the first serious contender to challenge Fortran’s supremacy.
The last couple of years have seen a growing wave of enthusiasm for object-oriented approaches
to requirements analysis, application design, and programming. The same period has been marked by
the increasing popularity of the C++ language and its acceptance as a logical successor to C. Since
C++ is designed to support object-oriented development, it seems only natural to see a strong link
between C++ and OOP. Programmers who move to C++ will apparently adopt an object-oriented style
of programming.
With C++, it is much easier to build and maintain really big code. This is made possible with C++’s
enhancements to C and more importantly, its object-oriented support. Some of the most prominent
concepts of object-oriented programming are encapsulation, data abstraction, inheritance, delegation,
polymorphism, and streams. All these features are covered in this book with illustrative programs.
xx Preface

A few other reasons for the success of C++(unlike other OOP languages) are
A strong backing from world-class software organizations (such as AT&T, Borland, Microsoft,
Sun Microsystems Inc, etc.)
Maturity of language
Availability of programming environment (language-sensitive editors, compilers, tools, profilers,
code analyzers, etc.)
Availability on machines—from microcomputers to supercomputers
Salient Features
Explanation of Object Oriented Concepts with the help of well-designed programming
examples
In-depth coverage of topics like Data Type, Operators and Expressions, Classes and Objects,
Object Initialization and Cleanup, Operator Overloading, Inheritance, Generic Programming
with Templates, and Exception Handling
Clear explanation of the language constructs using syntax, illustrations, code segments and
simple examples
Dedicated chapter on Object Oriented Analysis, and Design and Development
Newly introduced Case Studies
Organization of the Book
This book discusses the C++ language and object-oriented concepts over twenty chapters. Each
chapter explains C++ constructs needed for object-oriented programming with numerous programming
solutions. The book is organized as follows:
Chapter 1 (Object-Oriented Paradigm) discusses the need for new programming paradigms and
various aspects of object-oriented programming. It covers the evolution of programming paradigms,
elements of OOP, popular OOP languages, OO learning curve, software reuse, and demonstrates how
objects hold the key in driving future technologies.
Chapter 2 (Moving from C to C++) starts with the Hello World program demonstrating various
elements of a C++ program. It also presents new features added to C++ (apart from OOP) such as
streams-based I/O, scope-resolution operator, inline functions, function overloading, enhancements to
C structures, function templates, and new and delete operators for runtime memory management.
Chapter 3 (C+ + at a Glance) illustrates the various features supported by C++ for object-oriented
programming. Both chapters include illustrative examples of complete programs, rather than isolated
fragments. It discusses classes, objects, derived classes, operator overloading, virtual functions, class
templates, exceptions handling, and streams.
Chapters 4 through 9 discuss various fundamental elements of C and C++. These chapters are
devised keeping in mind the readers who are not familiar to the C language. The readers with C back-
ground will also benefit from these chapters, since emphasis is placed on their (data types, functions,
pointers, etc.) availability in C++ in a powerful form. Chapter 4 deals with basic data types, operators,
and expressions. Chapter 5 explains control flow: if, if-else, switch, for, while,
break, etc. Chapter 6 covers Arrays and Strings. Chapter 7 describes modular programming with
functions. It presents techniques of managing large software system development by breaking it into
multiple functions and modules. Chapter 8 emphasizes on structures and unions. Chapter 9 deals
with runtime memory management using pointers, emphasizing new features of C++ for dynamic
memory management.
Discovering Diverse Content Through
Random Scribd Documents
travel is along the river. Throughout the province almost the only
highways are footpaths across the jungles. From Hanoi roads lead
north to China and south to Hué. The influence of Hanoi, through
Anam, is widespread as a centre of fashion as well as of authority. A
French writer calls it the “Paris of the Anamese empire.” What more
could he say?

SCENE ON AN ORIENTAL RIVER.

The thickly-populated delta, intersected by streams and tidal


creeks, is subjected to periodical inundations, when the whole face of
the country has the appearance of an enormous lake, with here and
there clumps of trees, villages and pagodas. Away from the delta
only the valleys and lower slopes are cultivated, and the rest of the
province is a tangle of mountains covered with dense forests, of
which little is known, apart from the Songkoi and minor waterways,
unless from the reports of the natives or Roman Catholic
missionaries. The population of the province is estimated not to
exceed ten millions, probably less. The Anamese differ from those of
the south, the race being formed by a union of the hill-aborigines
with the seaboard people. The climate is not considered favorable for
Europeans. There are no Protestant missions in Anam.
This survey of the principal basins of Indo-China will enable the
reader to appreciate how largely the agricultural wealth and
commercial importance of all these countries depend on its rivers. It
is scarcely exaggeration to state that a few inches of water often
determine whether the receding flood at the annual inundation will
leave a bright, grain-laden plain or a sterile waste of ruined crops. It
should also be remembered that while periodical floods are common
to all the deltas, each valley has its own period, indicating that the
table-lands in which the rivers have their sources are at unequal
distances. Moreover, travel throughout the peninsula being so largely
aquatic, not only north and south along the main trunks, but across
the same valley by means of intersecting canals, tide plays an
important part in these waterway trips, and many smaller streams
being filled and emptied daily, a careful study of tidal influences will
avoid delay, as at times the water, suddenly receding, leaves a boat
stranded on the banks of some creek for hours, with no water even
for cooking or drinking purposes.

V. CLIMATE, PLANTS AND ANIMALS.


Far India, as this south-eastern corner of Asia is sometimes called,
has a tropical climate. At seasons the heat is intense, but in many
portions the warm air is genial and not unhealthy, though Europeans
need from time to time a change to a more bracing region. The
seasons are two—​the wet and the dry: the former embraces our
spring and summer months, and ranges from May to October; the
latter, the remainder of the year. March and April are the hottest
months; November, December and January, the coolest. The winter
is mild and summer-like—​doors and windows all open and no fire.
Houses are built without window-glass, and the shutters are seldom
closed except at night or to keep out the sun. Here, too, is the
verdure of perpetual summer—​lands where the foliage is always
green, where roses bloom from the first to the last day of the year,
and the orchards are always laden with their luscious store—​lands of
Italian sunsets, picturesque mountains, loveliest valleys, and long
stretches of comparatively still waters, said to resemble the Swiss
mountain-lakes, clear as crystal, reflecting the sky and great
mountain-shadows, and filled with fish; the grandest caves, the
richest mines of precious metals and valuable gems. Rice, the
principal article of food among the natives, grows almost
spontaneously, and is used on the table at an expense of three cents
a pound, while bananas are sold for two cents a dozen and oranges
for half a cent each.
It does not cost much to build a little bamboo house after the
native fashion. For example, Miss Cort paid for one of her
schoolhouses at Petchaburee, fourteen by twenty-two feet, only
$6.38 for the materials, including a lock and key; $5.44 for the
wages of the men and women who built it—​making the entire cost
$11.82. But then we should think it a very queer schoolhouse, with
its basket-like walls of woven bamboo, its roof of leaves sewed
together, its three little windows without any glass, and two doors;
nor would its strangeness be less striking if we saw the native
teacher and children all sitting on the floor. But things move slowly in
these warm Eastern countries. If you want to build a more
substantial house, you must begin by buying earth to make the
bricks, and oftentimes rough logs to be worked up into boards; and,
though labor is cheap, a day’s work in Indo-China will not mean
anything like as much accomplished as in the same space of time in
America.
In the useful arts the inhabitants of this peninsula are far behind
Chinese and Hindoos, though there are said to be ingenious workers
in copper and iron, and in the manufacture of gold and silver vessels
they display considerable skill.
Agriculture is the main employment of the natives. In many parts
of this peninsula the land is prepared by turning in the buffaloes
during the rainy season to trample down weeds and stir the soil,
which is afterward harrowed by a coarse rake or thorny shrub, the
stubble being burnt and the ash worked in as manure.
But the Chinese are everywhere introducing improved methods.
The best quality of rice is transplanted, the plants lying partially
covered in the still pools of water between the rectangular ridges
marked off for the purpose of irrigation; and rice growing above the
rising water looks very like a field of wheat or tall grass. At high-flood
seasons it is a pretty sight to see the planters moving about in boats
attending to their crops. The growth is almost spontaneous. Little
care is needed until the whole family must turn out to drive off the
immense flocks of little rice-birds. The rice is sown in June,
transplanted in September and harvested late in December or in
January. In the fields at this season may be seen the reapers,
multitudes of sheaves and stacks of grain. The rice is generally
threshed by buffaloes, a hard circle being formed around each stack.
The carts have large wheels, four or five feet apart, with the sheaves
placed in a small rack. The driver guides the oxen by means of ropes
fastened in the septum of their noses, reminding one of the
Scripture, “I will put my hook in his nose.”
Sugar is produced almost everywhere, in Siam especially, under
the Chinese settlers, its quality yielding to that of no other sugar in
the world, so that it is fast becoming one of the most important
Siamese exports. Almost all the spices used throughout the world
find their early home in the peninsula or the neighboring islands—​the
laurel-leaf clove; the nutmeg, like a pear tree in size, its nut wrapped
in crimson mace and encased in a shell; the cardamom, a plant
valuable for its seeds and the principal ingredient in curries and
compound spices. A pepper-plantation is a curious sight, the berries
growing, not in pods, but hanging down in bunches like currants
from a climber trained much like a hop-vine, yielding two annual and
very profitable crops. Tea is cultivated in the Laos provinces, and
coffee and cotton are also raised. Tobacco is largely grown, and its
use is almost universal; even babies in their mothers’ arms are often
seen puffing a cigar. A fine aromatic powder, made from the deep
golden root of the curcuma, is sold by the boatload in Bangkok;
Siamese mothers may be seen in the morning yellowing their
children with it for beauty. It is also used to give color to curries, and
mixed with quicklime makes the bright pink paste wrapped in seri-
leaf around the betel-nut for chewing purposes.
Vegetable-gardens and fruit-orchards surround most of the
villages. The neat Chinese gardens near Bangkok are worth a visit.
The land is made sufficiently dry by throwing it up in large beds ten
to twelve feet high, extending the whole length of the grounds. The
deep ditches between have a supply of water even in the dry season,
and a simple instrument is used to sprinkle the plants with it several
times a day. The gardener lives within the premises, his small dirty
hut guarded by a multitude of dogs and a horrible stench of pigsty.
The artificial ridges of the paddy-fields beyond, three feet high, make
quite comfortable footpaths in the dry season.
THE BREAD-FRUIT.

The Indo-Chinese fruits are of great excellence of flavor, and


almost every day of the year furnishes a new variety. The best
oranges are plentiful; pineapples are a drug in the market; lemons,
citrons, pomegranates are abundant and very cheap. As the season
advances, mangoes, guavas, custard-apples and the like follow in
quick succession; on some kinds of trees buds, flowers, green and
ripened fruit may be found at the same time. The small mahogany-
colored mangosteen is perhaps the most popular of tropical fruits.
One species of the sac has a fruit weighing from ten to forty pounds,
which cut in thick slices will supply a meal to twenty persons, and a
single tree will produce a hundred such fruit; the bright yellow wood
of this tree is used for dyeing the priests’ robes. The tamarind grows
to an enormous height and lives for centuries; under its shade the
Siamese assemble for most of their social games. The durian, a child
of the forest, has something the appearance of an elm; the large
fruit, cased in a thick hard rind as difficult to break as a cocoanut-
shell and covered with strong spines, gives a dangerous blow in
falling. The five shells within each contain several seeds rather larger
than a pigeon’s egg filled with custard-like pulp of a strong odor and
unique flavor. The plantain or banana has some forty varieties, with
fruit varying greatly in size as well as in flavor. It is the first fruit
given to babies, and, the Moslems say, was the gift of Allah to the
Prophet in his old age when he lost his teeth. The trees bear fruit but
once, and then are followed by others from the same root. The
useful bamboo is a tree-like plant with a jointed stem, producing
branches with willow-shaped leaves, which wave in the wind, giving
an elegant feathery appearance. So rapid is its growth, sometimes
two feet in a single day, that the plant attains its height of sixty to
seventy feet in a few months. It is said to have seven admirable
qualities—​strength, lightness, roundness, straightness, smoothness,
hollowness and divisibility. The short succulent shoots are served on
the table like asparagus, pickled or candied. According to the Chinese
proverb, the grains are “more abundant when rice fails.” The stems
furnish bottles, buckets, baskets, fishing-rods, posts, bridges, walls,
floors, roofs, and even the string that lashes together rafter and
beam of the common native house in Indo-China.
THE LOTUS.

Under the stimulating sunshine of the tropics a profusion of rare


shrubs and some of the most beautiful flowers reward slight labor
with a rapidity of growth and bloom unknown in colder regions.
Roses of one sort or another are perennial. Bright geraniums, brilliant
lilies and numberless plants indigenous to the country are in great
demand and cultivated extensively for domestic or religious uses.
There are seven varieties of the lotus, the favorite sacred flower of
all Buddhist countries. The red pond-lotus is most common; the blue,
green, light and dark-yellow flowers are rarer. The smallest variety
has a white flower scarcely larger than a daisy, and is found in the
rivers, principally at the season of inundation. The rose-colored lotus,
whose golden stamens breathe a delicious fragrance, is the ornament
of all festivities, and is sent as an offering to royalty, the priests and
Buddha himself. The mali, a fragrant white flower about the size of a
pink, is much cultivated in the neighborhood of Bangkok. It grows on
a shrub about three feet high. The wreaths worn around the
topknots of children are braided from this flower, which is also used
for necklaces, bracelets and to perfume water. Rare and beautiful
orchids are also here in large numbers, and many of the varicolor-
leaved plants find this their native home.
Throughout the Indo-Chinese peninsula are great belts of
trackless forests of teak and other valuable woods, tropical trees
yielding rich gums and aromatic odors—​the tall, exquisitely graceful
wood-oil tree; the india-rubber, gutta-percha—​first discovered in
Malayland—​and other varieties of the Ficus; the cajaput, the upas,
the gamboge. There are thousands of miles of these jungles never
yet subdued by man, through whose green twilight the traveler can
only force his way axe in hand. Here are majestic trees, it may be a
hundred and fifty feet high and of great girth, draped with a whole
world of dangling vines and parasite trailers, spreading everywhere a
canopy of leaf and gorgeous blossoms; the liana hanging its scarlet
and orange clusters a hundred feet overhead across some stream;
tough ratan cables a thousand feet long, knotting together a whole
grove; avenues of intersecting branches, like the aisles of a Gothic
cathedral, covered with yellow flowers of a most delicious fragrance;
the white and purple of the pemea, combining the beauties of the
rhododendron and horse-chestnut; the blue-blossoming Thunbergia;
the Burmese Amherstia, like a giant fuchsia on the scale of an oak.
Then there is the graceful palm tribe—​the palmyra; the date; the
lofty areca with its sweet-scented buds and great clusters of nuts;
the tufted-crowned, sea-loving cocoanut, whose fruit supplies food,
drink and oil, its fibrous casing ropes, vessels and mats, and its
plaited leaves dishes and the thatch of the native’s cottage, the large
stalks fences, and whose slender bole is adapted for innumerable
uses from a post to a canoe. Underneath all this Oriental shade a
lovely confusion of fungi, mosses, and every variety of ferns, from
delicate maiden-hair to the tall fronds fifteen and twenty feet high.
BIRD OF PARADISE.

Birds of brilliant plumage and beautiful form inhabit these Oriental


forests—​long-legged swamp-fowls, tall as a man and swift as a
greyhound; paroquets with green bodies and scarlet beaks fly
screaming from tree to tree; the snowy pelican, the white ibis, the
argus, the blue-jay, the black and white robin; birds of paradise and
humming-birds. The sea-swallow builds her nest in the hollows and
caves of the rocky coast, and doves and pigeons are in endless
variety. Winged things of myriad kinds troop, great and small—​
immense butterflies, jewel-like beetles, brilliant dragon-flies,
thousands of moths—​while at dusk swarms of fire-flies illumine the
glades, and the night is noisy with the flitting and buzzing of the
insect world.
Animals fierce and large as those of Africa infest these jungles;
their footprints are all along the paths—​wild elephants and boars, the
tapir, the royal tiger, the one-horned rhinoceros, the buffalo, herds of
deer, wild hogs and squirrels, afford a sportsman plenty of use for his
gun; uncanny flying-foxes, and chattering monkeys linked, chain-
fashion, hand to tail, or pelting each other with fruit and nuts.
Innumerable water-snakes glide among the reeds; the cobra or
hooded serpent is abundant; surly alligators, with their ugly red
mouths wide open, and huge saurians bask in sunny spots or float
like logs upon the surface of the water; leeches abound in the
swampy lowlands; frogs and turtles and tortoises, larger than any
ever seen in temperate regions, throng the marshes and streams.

MONKEYS PLAYING WITH A CROCODILE.

Indo-China also offers a first field of inquiry to the geologist. The


peninsula is very rich in minerals; gold is said to be most productive
at the foot of the “Three Hundred Peaks;” copper and tin are found
in large quantities; silver in connection with copper and lead; and
there are unquestionably large unworked deposits of coal and
petroleum. Precious stones, brilliant diamonds, deep-blue sapphires,
rubies of finest color, emeralds, topazes, rock-crystals and other
gems used to ornament the crowns of kings and emperors are a part
of the natural wealth.
*****
Such, then, are the general characteristics and geographical
outlines of the Indo-Chinese peninsula.
CHAPTER II.

SIGHT-SEEING IN BANGKOK.

T give you some idea of Bangkok, the capital city of Siam, I will
o
imagine myself once more a resident there, with you for a visitor,
and will invite you this fine morning to take a seat in our family boat,
which is at the landing, and we will go out upon the river.
It is a strange city, unlike any in the Western World, and if we
cannot “see the lions,” we may perhaps “see the elephants” and
many novel and interesting things. You have already become
somewhat familiar with the copper-colored complexion, the black
eyes, black hair and black teeth, the scanty clothing and shaven
heads of the people.
We will confine our excursion to-day to the Menam River, the
Broadway of Bangkok, while the hundreds of canals that intersect it
at every angle may be considered the less-important streets. You find
the river a busy scene, but need have no fears of a collision with any
of the innumerable boats of every size and description that pass, for
the Siamese are very skillful boatmen.
Your attention is already attracted by the beautiful wat, or temple,
with its surroundings, on our right. Is it not a beautiful spot, so
prettily laid out with fine shade trees, flowering plants and well-
swept walks? There are about two hundred wats in Bangkok
consecrated to the worship of Buddha. Some of them have groves
several acres in extent, containing pagodas, image-houses, priests’
dwellings and salas, or lounging-places. They occupy the pleasantest
parts of the city, and the deluded people spend vast sums on these
temples and their idols, expecting in this way to make merit for
themselves. You will not wonder that they are anxious to make all
the merit they can when their religion teaches them that at death
their soul enters the body of some animal—​a bird, it may be, or a
snake, an elephant or a buffalo—​unless they have made enough
merit to be born something better and higher.

BANGKOK ON THE MENAM.

Observe the exterior of this temple. What a gay appearance the


neat-colored tiles give the roof! The front, how laboriously carved
and how richly gilded! The doors and windows too are more or less
carved and gilded. Now we will go inside. The scenes with which
these inner walls are so gayly painted are chiefly from the life of
Buddha, and see, in the farther end, on an ornamental throne, is an
immense gilt image of this deity in a sitting posture. This is made of
brick and mortar, but idols are sometimes of gold, silver, brass, ivory,
wood and stone. All have the same self-complacent, sleepy look.
Look! a worshiper has followed us in. Watch his movements. See him
prostrate himself before the idol, touching his forehead three times
to the floor, and now he lays his simple offering of flowers upon the
altar. Mark the complacency of his countenance as he leaves, no
doubt feeling that he has added not a little to his stock of merit.
HOUSE-SPARROW.

But we must return to our boat and move on up the river, for I
hope to have time to visit the royal temple and perhaps some others.
Ah! there are some priests. I feared we should not meet any of
these yellow-robed gentry. How strange they look with shaven heads
and eyebrows! Such as these are the religious teachers of the
country. A few years ago there were ten thousand in Bangkok alone
and some thirty thousand in the kingdom—​a perfect army (with few
exceptions) of self-conceited idlers; but I am happy to tell you that
their number has now greatly diminished. They live on the charity of
the people, going about every morning from house to house among
their parishioners, with their alms-bowl, and with a fruit-bag slung
over one shoulder. The old mother or grandmother is up at an early
hour to have rice cooked and ready for them. She puts a ladleful of
hot rice into the bowl of each as he passes, and a handful of fruit
into his fruit-bag. Do they thank her? By no means. She ought rather
to thank them, for they have given her an opportunity to make merit.
They collect sufficient for their morning and noonday meal. Their
religion forbids them to take food after midday.
Notice the boats. Some, used for trading, are loaded with rice,
sugar, salt, cotton, oil, dried fish, or dye-woods, as the case may be.
Some are at once boat, shop and dwelling. In the distance is a
nobleman’s boat, propelled by a dozen or two paddlers. What an odd
little house in the centre! Do you see how much at his ease His
Lordship is reclining, with two or three attendants down on their
elbows and knees before him? Look yonder at that small boat
paddled by a little child five or six years old. How unconcerned the
little fellow seems as he moves about entirely alone, his boat hardly
larger than himself, the edge scarcely two inches above the water!
Men, women and children in this country can swim; should this child
upset he would look out for himself and think very little of the matter.
Many smaller craft are market-boats, with fruits and vegetables
for sale. Notice some of the fruits as they pass. That one nearly as
large as a child’s head and resembling a huge orange is the shaddock
or pomelow. This large one, which smells so very disagreeably, and
which is so completely encased in spines as if to say, “Touch me not!”
is the far-famed durian, which the natives consider the king of fruits.
It weighs from five to ten pounds. This small round mahogany-
colored fruit is the delicious mangosteen—​that golden one, the
luscious mango. Then there are the rich custard-apple, the refreshing
orange, the blushing rhambutan, the pineapple, the banana, etc.
You see the flags of many different nations flying from the ships,
of which none are more beautiful than the “star-spangled banner” of
our native land. There are also scores of steam-yachts on the rivers
of Siam now, owned by the natives, but when I first came here there
was not one to be seen. You ask what these strange-looking craft,
moored by immense ratan cables, are? They are Chinese junks, and
it would be hard to tell where the Chinese obtained their model. The
wonder is that such clumsy, unshapely, unsightly things can be made
to traverse the sea. And the glowing colors in which they are
painted, red always predominating! And don’t overlook the large eye
painted on each bow. The Chinese say, “No got eye, how can see?”
But you must not get so much interested in the boats and the
fruits as not to notice the homes of this people. Many of the princes
and nobles now have fine houses handsomely furnished. The
missionaries, foreign consuls, merchants and wealthy Chinese have
good, substantial dwellings. The homes of the common people, you
see, are small, of one story, and thatched with the leaves of the
attap palm. Most of them are neither painted nor whitewashed.
Those upon the land are placed on posts six feet high, and the sides
of many of them are made of bamboos split and woven together,
forming a kind of basket-work.
But thousands of the people live in floating houses, which you
have observed lining both banks of the river. Notice them particularly
now, for they are one of the peculiarities of this Eastern city. They
are but one story high, you see, and built of boards and placed on
rafts of large bamboos, which rise and fall with the tide, and hence
are called floating houses. These rafts must be renewed every two or
three years. The houses are kept in their place by large posts on
each side driven deep into the muddy bed of the river. They do
sometimes, however, get detached from their moorings, though
fastened to them by rings of ratan, and float up or down the river
with the tide. These houses have some advantages over all others,
for if neighbors are disagreeable or a fire breaks out the occupants
have only to move off with the tide, house, furniture and all, to some
other spot.

FLOATING STORES AT BANGKOK.


You will observe that many of them are open in front with a
veranda, and are shops. This one seems to have a variety, and we
will stop a few moments. You perceive there are no showcases, but
the smaller and more fanciful articles are displayed on these shelves,
arranged one above another, like a flower-stand, to the height of
some three feet. Are you waiting for the shopkeeper? The personage
seated on the floor by the side of his goods is none other than he.
He seems quite indifferent about selling, but look about and see
what of all this mixed medley you will purchase. There, in the way of
dry goods, are bleached and unbleached and turkey-red muslins,
Siamese waist-cloths and some fading calicoes. Here are a few boxes
of tea, some native umbrellas, a bunch of peacock-feathers, tigers’
skins and tigers’ bones, piles of coarse crockery, pieces of matting,
etc. There are also pretty little brown teapots and tiny cups, all of
which at home would be considered toys for children, but, I assure
you, they are as large as any used by the tea-drinkers of this
country. There is a set now on a little tray behind you that are in
daily use. Ah! you want to purchase a set with the tray, do you? Well,
you have made a very good selection, but the shopman may not
fancy your flat silver coins, though they are fast being introduced.
Make your selection and I will pay your bills. I have yet to show you
the money of the country. See! a stamped silver bullet, with a small
notch cut out of one side. What does it remind you of? I do not
wonder you smile. This largest piece is a tical, and is worth sixty
cents; this next size is a salung, or fifteen cents; this smallest a
fuang, or seven and a half cents. If I had come shopping with you a
few years ago, and you had wanted any smaller change, I should
have used cowrie-shells, of which it took one thousand to equal a
dime. The shopman is paid, and now with the Siamese good-bye,
Chah! lah! pi kaun, we must move on. Do not think these are the
only shopping-places in the city, for besides several fine foreign
stores we might, if we had time, go up into the Chinese bazaar,
which is about a mile long. We should find there tailors, blacksmiths,
druggists, goldsmiths, idol-makers, dyers, etc.
We are just passing a floating-house restaurant. We will move
slowly and see what they have—​pork steaks, ducks, fowls, hot rice
and curry, dried fish and vegetables. Shall we call? No? Well, then,
we will take our own lunch that we have brought with us, and,
refreshed by it, be ready to visit a royal temple which we shall soon
reach.
Notice this large canal on our right, for it extends entirely around
the city proper, following the line of the city-wall, which is five miles
in circumference, till it meets the river again.
Do you notice that smoke rising in yonder temple-ground? It is
from a funeral pile, for in this country the dead are burned, unless
they committed suicide, were struck by lightning or died of cholera or
some other disease causing sudden death, in which case they are
considered as deficient in merit and undeserving of burning. You will
be surprised when I tell you that two armsful of wood are sufficient
to reduce a body to ashes.
Look at that lofty tower on the left, rising full two hundred feet,
with such exquisite proportions. It is considered the finest pagoda in
Bangkok, but I think the four tall, gracefully-tapered spires in the
wat-ground directly opposite are not much behind in beauty. Under
the long, tiled roof near them reclines an image of Buddha which is
perhaps the largest idol in the world. There is a huge one on this
side that towers up seventy feet as it sits cross-legged, but we will
cross over and visit the larger one, the “Sleeping Idol.” Let us land
and look about a while before we enter the principal temple. You see
there are other temple-buildings and small pagodas, besides the
usual houses for the hundreds of priests. In one of these temples are
to be seen four hundred images of Buddha, life-size and each seated
on a gilded throne. Now we will go in and see the immense image.
The temple itself is two hundred feet long, and the idol at least one
hundred and sixty feet long. You see it lies on its side, as if asleep. It
is made of brick and heavily gilded. I suppose the gold-leaf is of
many thicknesses in some places, for worshipers generally stick on a
fresh piece. As we have our yard-measure, let us see how long the
feet are. Five yards and more! and each toe is one yard long!
Buddha’s toes and fingers are supposed to have been all of one
length, and look at the soles of the great feet, so beautifully inlaid
with figures in mother-of-pearl!
But come, we must not linger longer here. The palace of His
Majesty is near, and we must get a glimpse of this, though I fear its
exterior will not be as imposing as you thought. The palace-grounds
are enclosed by a wall about a mile in circumference. Here are the
audience-halls, the mint, arsenal, halls of justice, museum, royal
chapel, and separated from them by an inner wall is the royal harem,
which is in itself a compact little town, with several streets, a bazaar,
a temple, pleasure-gardens and the homes of the numerous wives,
sisters and other relatives of the king.
This gate in the city-wall will give us access to the stables of the
elephants. Were it early in the morning we should see them coming
down to the river to bathe and drink.
Our walk takes us through a market, but you must not look for
neatness or order, only a confused display of vegetables and fruits,
betel-nuts, cigars, odd-looking cakes, eggs, salted and fresh fish,
dried meats. But why this commotion? Ah! the reason is plain, for
there, with his train of attendants, comes a prince borne rapidly
along in an open palanquin on the shoulders of men, and the traders
and customers must make way for him. Ten years ago all, as if
impelled by one impulse, would have respectfully dropped down on
elbows and knees, but the present young king has done away with
this servile custom. Ten years ago hat or cap, stockings or shoes,
would not have been needed to denote his greatness, the number of
his retinue showing that. Notice his attendants. One carries an
immense state umbrella over the head of His Lordship; then there is
the sword-bearer and the pipe-bearer; one carries his gold betel-box
and tray, another his spittoon; one has his lighted match-rope,
another his fan, and another his golden vessel of drinking-water. Now
the prince has passed, and we may go on our way to the elephant-
stables, which are very neat. Let us venture in. You need not fear
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like