100% found this document useful (7 votes)
276 views

Full download (Ebook) Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards by Slobodan Dmitrović ISBN 9781484260463, 1484260465 pdf docx

The document provides information about various ebooks available for download, particularly focusing on 'Modern C++ for Absolute Beginners' by Slobodan Dmitrović, which serves as an introduction to C++ programming and covers standards from C++11 to C++20. It includes links to multiple editions of the book and other educational resources, along with details on supplementary materials available on GitHub. Additionally, it outlines the book's contents, including chapters on C++ fundamentals, functions, classes, and the C++ Standard Library.

Uploaded by

anayetpuiyuk7
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 (7 votes)
276 views

Full download (Ebook) Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards by Slobodan Dmitrović ISBN 9781484260463, 1484260465 pdf docx

The document provides information about various ebooks available for download, particularly focusing on 'Modern C++ for Absolute Beginners' by Slobodan Dmitrović, which serves as an introduction to C++ programming and covers standards from C++11 to C++20. It includes links to multiple editions of the book and other educational resources, along with details on supplementary materials available on GitHub. Additionally, it outlines the book's contents, including chapters on C++ fundamentals, functions, classes, and the C++ Standard Library.

Uploaded by

anayetpuiyuk7
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/ 55

Download Full Version ebook - Visit ebooknice.

com

(Ebook) Modern C++ for Absolute Beginners: A


Friendly Introduction to C++ Programming Language
and C++11 to C++20 Standards by Slobodan Dmitrovi
ISBN 9781484260463, 1484260465
https://ebooknice.com/product/modern-c-for-absolute-
beginners-a-friendly-introduction-to-c-programming-language-
and-c-11-to-c-20-standards-11279556

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Modern C++ for Absolute Beginners: A Friendly


Introduction to the C++ Programming Language and C++11 to
C++23 Standards, 2nd Edition by Slobodan Dmitrovi■ ISBN
9781484292730, 1484292731
https://ebooknice.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-the-c-programming-language-
and-c-11-to-c-23-standards-2nd-edition-48278302
ebooknice.com

(Ebook) Modern C for Absolute Beginners: A Friendly


Introduction to the C Programming Language by Slobodan
Dmitrovi■ ISBN 9781484266427, 1484266420
https://ebooknice.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-the-c-programming-language-23942578

ebooknice.com

(Ebook) Modern C for Absolute Beginners: A Friendly


Introduction to the C Programming Language by Dmitrovi■,
Slobodan ISBN 9781484266434, 1484266439
https://ebooknice.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-the-c-programming-language-23942580

ebooknice.com

(Ebook) Modern C for Absolute Beginners: A Friendly


Introduction to the C Programming Language by Slobodan
Dmitrovi■ ISBN 9798868802232, 8868802236
https://ebooknice.com/product/modern-c-for-absolute-beginners-a-
friendly-introduction-to-the-c-programming-language-56083684

ebooknice.com
(Ebook) Primary Mathematics Workbook 2B by Jennifer Hoerst
ISBN 9780761469933, 0761469931

https://ebooknice.com/product/primary-mathematics-workbook-2b-23520620

ebooknice.com

(Ebook) Primary Mathematics Textbook 2B by Jennifer Hoerst


ISBN 9780761469797, 0761469796

https://ebooknice.com/product/primary-mathematics-textbook-2b-23519854

ebooknice.com

(Ebook) Modern C++ for Absolute Beginners: A Friendly


Introduction to C++ Programming Language and C++11 to
C++20 Standards by Slobodan Dmitrovi■ ISBN 9781484260470,
1484260473, b6f80b55-cf7e-44ca-902e-e3927f78fbfc,
https://ebooknice.com/product/modern-c-for-absolute-beginners-a-
B6F80B55-CF7E-44CA-902E-E3927F78FBFC
friendly-introduction-to-c-programming-language-
and-c-11-to-c-20-standards-44441424
ebooknice.com

(Ebook) My Pals are Here! Maths Pupil's Book 2B by Unknown


ISBN 9789810119355, 9810119356

https://ebooknice.com/product/my-pals-are-here-maths-pupil-s-
book-2b-55756818

ebooknice.com

(Ebook) Final FRCR 2B Long Cases: A Survival Guide by


Jessie Aw, John Curtis ISBN 9780521740692, 052174069X

https://ebooknice.com/product/final-frcr-2b-long-cases-a-survival-
guide-1828512

ebooknice.com
Slobodan Dmitrović

Modern C++ for Absolute Beginners


A Friendly Introduction to C++ Programming
Language and C++11 to C++20 Standards
1st ed.
Slobodan Dmitrović
Belgrade, Serbia

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​9781484260463. For more
detailed information, please visit http://​www.​apress.​com/​source-code.

ISBN 978-1-4842-6046-3 e-ISBN 978-1-4842-6047-0


https://doi.org/10.1007/978-1-4842-6047-0

© Slobodan Dmitrović 2020

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

Distributed to the book trade worldwide by Apress Media, LLC, 1 New


York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax
(201) 348-4505, e-mail [email protected], or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the
sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
To M. R., whose work is an inspiration to me.
Acknowledgments
I would like to thank my friends and fellow C++ peers who have
supported me in writing this book.
I owe my gratitude to outstanding professionals at Apress for their
amazing work and support during the entire writing and production
process.
I am thankful to the StackOverflow and the entire C++ community
for their help and feedback.
My deepest appreciation goes to S. Antonijević, Jovo Arežina, and
Saša Popović for their ongoing support.
Table of Contents
Chapter 1:​Introduction
Chapter 2:​What is C++?​
2.​1 C++ Standards
Chapter 3:​C++ Compilers
3.​1 Installing C++ Compilers
3.​1.​1 On Linux
3.​1.​2 On Windows
Chapter 4:​Our First Program
4.​1 Comments
4.​2 Hello World Example
Chapter 5:​Types
5.​1 Fundamental Types
5.​1.​1 Boolean
5.​1.​2 Character Type
5.​1.​3 Integer Types
5.​1.​4 Floating-Point Types
5.​1.​5 Type void
5.​2 Type Modifiers
5.​3 Variable Declaration, Definition, and Initialization
Chapter 6:​Exercises
6.​1 Hello World and Comments
6.​2 Declaration
6.​3 Definition
6.​4 Initialization
Chapter 7:​Operators
7.​1 Assignment Operator
7.​2 Arithmetic Operators
7.​3 Compound Assignment Operators
7.​4 Increment/​Decrement Operators
Chapter 8:​Standard Input
Chapter 9:​Exercises
9.​1 Standard Input
9.​2 Two Inputs
9.​3 Multiple Inputs
9.​4 Inputs and Arithmetic Operations
9.​5 Post-Increment and Compound Assignment
9.​6 Integral and Floating-point Division
Chapter 10:​Arrays
Chapter 11:​Pointers
Chapter 12:​References
Chapter 13:​Introduction to Strings
13.​1 Defining a String
13.​2 Concatenating Strings
13.​3 Accessing Characters
13.​4 Comparing Strings
13.​5 String Input
13.​6 A Pointer to a String
13.​7 Substrings
13.​8 Finding a Substring
Chapter 14:​Automatic Type Deduction
Chapter 15:​Exercises
15.​1 Array Definition
15.​2 Pointer to an Object
15.​3 Reference Type
15.​4 Strings
15.​5 Strings from Standard Input
15.​6 Creating a Substring
15.​7 Finding a single Character
15.​8 Finding a Substring
15.​9 Automatic Type Deduction
Chapter 16:​Statements
16.​1 Selection Statements
16.​1.​1 if Statement
16.​1.​2 Conditional Expression
16.​1.​3 The Logical Operators
16.​1.​4 switch Statement
16.​2 Iteration Statements
16.​2.​1 for Statement
16.​2.​2 while Statement
16.​2.​3 do Statement
Chapter 17:​Constants
Chapter 18:​Exercises
18.​1 A Simple if-statement
18.​2 Logical Operators
18.​3 The switch-statement
18.​4 The for-loop
18.​5 Array and the for-loop
18.​6 The const Type Qualifier
Chapter 19:​Functions
19.​1 Introduction
19.​2 Function Declaration
19.​3 Function Definition
19.​4 Return Statement
19.​5 Passing Arguments
19.​5.​1 Passing by Value/​Copy
19.​5.​2 Passing by Reference
19.​5.​3 Passing by Const Reference
19.​6 Function Overloading
Chapter 20:​Exercises
20.​1 Function Definition
20.​2 Separate Declaration and Definition
20.​3 Function Parameters
20.​4 Passing Arguments
20.​5 Function Overloads
Chapter 21:​Scope and Lifetime
21.​1 Local Scope
21.​2 Block Scope
21.​3 Lifetime
21.​4 Automatic Storage Duration
21.​5 Dynamic Storage Duration
21.​6 Static Storage Duration
21.​7 Operators new and delete
Chapter 22:​Exercises
22.​1 Automatic Storage Duration
22.​2 Dynamic Storage Duration
22.​3 Automatic and Dynamic Storage Durations
Chapter 23:​Classes - Introduction
23.​1 Data Member Fields
23.​2 Member Functions
23.​3 Access Specifiers
23.​4 Constructors
23.​4.​1 Default Constructor
23.​4.​2 Member Initialization
23.​4.​3 Copy Constructor
23.​4.​4 Copy Assignment
23.​4.​5 Move Constructor
23.​4.​6 Move Assignment
23.​5 Operator Overloading
23.​6 Destructors
Chapter 24:​Exercises
24.​1 Class Instance
24.​2 Class with Data Members
24.​3 Class with Member Function
24.​4 Class with Data and Function Members
24.​5 Class Access Specifiers
24.​6 User-defined Default Constructor and Destructor
24.​7 Constructor Initializer List
24.​8 User-defined Copy Constructor
24.​9 User-defined Move Constructor
24.​10 Overloading Arithmetic Operators
Chapter 25:​Classes – Inheritance and Polymorphism
25.​1 Inheritance
25.​2 Polymorphism
Chapter 26:​Exercises
26.​1 Inheritance
Chapter 27:​The static Specifier
Chapter 28:​Templates
Chapter 29:​Enumerations
Chapter 30:​Exercises
30.​1 Static variable
30.​2 Static data member
30.​3 Static member function
30.​4 Function Template
30.​5 Class Template
30.​6 Scoped Enums
30.​7 Enums in a switch
Chapter 31:​Organizing code
31.​1 Header and Source Files
31.​2 Header Guards
31.​3 Namespaces
Chapter 32:​Exercises
32.​1 Header and Source Files
32.​2 Multiple Source Files
32.​3 Namespaces
32.​4 Nested Namespaces
Chapter 33:​Conversions
33.​1 Implicit Conversions
33.​2 Explicit Conversions
Chapter 34:​Exceptions
Chapter 35:​Smart Pointers
35.​1 Unique Pointer
35.​2 Shared Pointer
Chapter 36:​Exercises
36.​1 static_​cast Conversion
36.​2 A Simple Unique Pointer:​
36.​3 Unique Pointer to an Object of a Class
36.​4 Shared Pointers Exercise
36.​5 Simple Polymorphism
36.​6 Polymorphism II
36.​7 Exception Handling
36.​8 Multiple Exceptions
Chapter 37:​Input/​Output Streams
37.​1 File Streams
37.​2 String Streams
Chapter 38:​C++ Standard Library and Friends
38.​1 Containers
38.​1.​1 std:​:v
​ ector
38.​1.​2 std:​:a
​ rray
38.​1.​3 std:​:s​ et
38.​1.​4 std:​:m
​ ap
38.​1.​5 std:​:p
​ air
38.​1.​6 Other Containers
38.​2 The Range-Based for Loop
38.​3 Iterators
38.​4 Algorithms and Utilities
38.​4.​1 std:​:s​ ort
38.​4.​2 std:​:f​ ind
38.​4.​3 std:​:c​ opy
38.​4.​4 Min and Max Elements
38.​5 Lambda Expressions
Chapter 39:​Exercises
39.​1 Basic Vector
39.​2 Deleting a Single Value
39.​3 Deleting a Range of Elements
39.​4 Finding Elements in a Vector
39.​5 Basic Set
39.​6 Set Data Manipulation
39.​7 Set Member Functions
39.​8 Search for Data in a Set
39.​9 Basic Map
39.​10 Inserting Into Map
39.​11 Searching and Deleting From a Map
39.​12 Lambda Expressions
Chapter 40:​C++ Standards
40.​1 C++11
40.​1.​1 Automatic Type Deduction
40.​1.​2 Range-based Loops
40.​1.​3 Initializer Lists
40.​1.​4 Move Semantics
40.​1.​5 Lambda Expressions
40.​1.​6 The constexpr Specifier
40.​1.​7 Scoped Enumerators
40.​1.​8 Smart Pointers
40.​1.​9 std:​:u
​ nordered_​set
40.​1.​10 std:​:u
​ nordered_​map
40.​1.​11 std:​:t​ uple
40.​1.​12 static_​assert
40.​1.​13 Introduction to Concurrency
40.​1.​14 Deleted and Defaulted Functions
40.​1.​15 Type Aliases
40.​2 C++14
40.​2.​1 Binary Literals
40.​2.​2 Digits Separators
40.​2.​3 Auto for Functions
40.​2.​4 Generic Lambdas
40.​2.​5 std:​:m
​ ake_​unique
40.​3 C++17
40.​3.​1 Nested Namespaces
40.​3.​2 Constexpr Lambdas
40.​3.​3 Structured Bindings
40.​3.​4 std:​:f​ ilesystem
40.​3.​5 std:​:s​ tring_​view
40.​3.​6 std:​:a
​ ny
40.​3.​7 std:​:v
​ ariant
40.​4 C++20
40.​4.​1 Modules
40.​4.​2 Concepts
40.​4.​3 Lambda Templates
40.​4.​4 [likely] and [unlikely] Attributes
40.​4.​5 Ranges
40.​4.​6 Coroutines
40.​4.​7 std:​:s​ pan
40.​4.​8 Mathematical Constants
Summary and Advice
The go-to Reference
StackOverflow
Other Online Resources
Other C++ Books
Advice
Index
About the Author
Slobodan Dmitrović
is a software development consultant
and an author from Serbia. He
specializes in C++ training, technical
analysis, and software architecture. He is
a highly visible member of the SE
European C++ community and a
StackOverflow contributor. Slobodan has
gained international experience working
as a software consultant in Denmark,
Poland, Croatia, China, and the
Philippines. Slobodan maintains a
website at www.cppandfriends.com
.
About the Technical Reviewer
Chinmaya Patnayak
is an embedded software developer at
NVIDIA and is skilled in C++, CUDA, deep
learning, Linux, and file systems. He has
been a speaker and instructor for deep
learning at various major technology
events across India. Chinmaya holds an
M.Sc. degree in physics and B.E. in
electrical and electronics engineering
from BITS Pilani. He has previously
worked with Defence Research and
Development Organization (DRDO) on
encryption algorithms for video streams.
His current interest lies in neural
networks for image segmentation and applications in biomedical
research and self-driving cars. Find more about him at
chinmayapatnayak.github.io.
© Slobodan Dmitrović 2020
S. Dmitrović, Modern C++ for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6047-0_1

1. Introduction
Slobodan Dmitrović 1
(1) Belgrade, Serbia

Dear Reader,
Congratulations on choosing to learn the C++ programming
language, and thank you for picking up this book. My name is Slobodan
Dmitrović, I am a software developer and a technical writer, and I will
try to introduce you to a beautiful world of C++ to the best of my
abilities.
This book is an effort to introduce the reader to a C++ programming
language in a structured, straightforward, and friendly manner. We will
use the “just enough theory and plenty of examples” approach
whenever possible.
To me, C++ is a wonderful product of the human intellect. Over the
years, I have certainly come to think of it as a thing of beauty and
elegance. C++ is a language like no other, surprising in its complexity,
yet wonderfully sleek and elegant in so many ways. It is also a language
that cannot be learned by guessing, one that is easy to get wrong and
challenging to get right.
In this book, we will get familiar with the language basics first.
Then, we will move onto standard-library. Once we got these covered,
we will describe the modern C++ standards in more detail.
After each section, there are source code exercises to help us adopt
the learned material more efficiently. Let us get started!
© Slobodan Dmitrović 2020
S. Dmitrović, Modern C++ for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6047-0_2

2. What is C++?
Slobodan Dmitrović 1
(1) Belgrade, Serbia

C++ is a programming language. A standardized, general-purpose,


object-oriented, compiled language. C++ is accompanied by a set of
functions and containers called the C++ Standard-Library. Bjarne
Stroustrup created C++ as an extension to a C programming language.
Still, C++ evolved to be a completely different programming language.
Let us emphasize this: C and C++ are two different languages. C++
started as “C with classes,” but it is now a completely different language.
So, C++ is not C; C++ is not C with classes; it is just C++. And there is no
such thing as a C/C++ programming language.
C++ is widely used for the so-called systems programming as well as
application programming. C++ is a language that allows us to get down
to the metal where we can perform low-level routines if needed, or soar
high with abstraction mechanisms such as templates and classes.

2.1 C++ Standards


C++ is governed by the ISO C++ standard. There are multiple ISO C++
standards listed here in chronological order: C++03, C++11, C++14,
C++17, and the upcoming C++20 standard.
Every C++ standard starting with the C++11 onwards is referred to
as “Modern C++.” And modern C++ is what we will be teaching in this
book.
© Slobodan Dmitrović 2020
S. Dmitrović, Modern C++ for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6047-0_3

3. C++ Compilers
Slobodan Dmitrović 1
(1) Belgrade, Serbia

C++ programs are usually a collection of C++ code spread across one or
multiple source files. The C++ compiler compiles these files and turns
them into object files. Object files are linked together by a linker to
create an executable file or a library. At the time of the writing, some of
the more popular C++ compilers are:
– The g++ frontend (as part of the GCC)
– Visual C++ (as part of the Visual Studio IDE)
– Clang (as part of the LLVM)

3.1 Installing C++ Compilers


The following sections explain how to install C++ compilers on Linux
and Windows and how to compile and run our C++ programs.

3.1.1 On Linux
To install a C++ compiler on Linux , type the following inside the
terminal:

sudo apt-get install build-essential

To compile the C++ source file source.cpp, we type:

g++ source.cpp
This command will produce an executable with the default name of
a.out. To run the executable file, type:

./a.out

To compile for a C++11 standard, we add the -std=c++11 flag:

g++ -std=c++11 source.cpp

To enable warnings, we add the -Wall flag:

g++ -std=c++11 -Wall source.cpp

To produce a custom executable name, we add the -o flag followed


by an executable name:

g++ -std=c++11 -Wall source.cpp -o myexe

The same rules apply to the Clang compiler. Substitute g++ with
clang++.

3.1.2 On Windows
On Windows , we can install a free copy of Visual Studio.
Choose Create a new project, make sure the C++ language option is
selected, and choose - Empty Project – click Next and click Create. Go to
the Solution Explorer panel, right-click on the project name, choose
Add – New Item – C++ File (.cpp), type the name of a file (source.cpp),
and click Add. Press F5 to run the program.
We can also do the following: choose Create a new project, make
sure the C++ language option is selected, and choose – Console App –
click Next and click Create.
If a Create a new project button is not visible, choose File – New –
Project and repeat the remaining steps.
© Slobodan Dmitrović 2020
S. Dmitrović, Modern C++ for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6047-0_4

4. Our First Program


Slobodan Dmitrović 1
(1) Belgrade, Serbia

Let us create a blank text file using the text editor or C++ IDE of our
choice and name it source.cpp. First, let us create an empty C++
program that does nothing. The content of the source.cpp file is:

int main(){}

The function main is the main program entry point, the start of our
program. When we run our executable, the code inside the main
function body gets executed. A function is of type int (and returns a
result to the system, but let us not worry about that just yet). The
reserved name main is a function name. It is followed by a list of
parameters inside the parentheses () followed by a function body
marked with braces {}. Braces marking the beginning and the end of a
function body can also be on separate lines:

int main()
{

This simple program does nothing, it has no parameters listed


inside parentheses, and there are no statements inside the function
body. It is essential to understand that this is the main program
signature.
There is also another main function signature accepting two
different parameters used for manipulating the command line
arguments. For now, we will only use the first form .

4.1 Comments
Single line comments in C++ start with double slashes // and the
compiler ignores them. We use them to comment or document the code
or use them as notes:

int main()
{
// this is a comment
}

We can have multiple single-line comments:

int main()
{
// this is a comment
// this is another comment
}

Multi-line comments start with the /* and end with the */. They
are also known as C-style comments. Example:

int main()
{
/* This is a
multi-line comment */
}

4.2 Hello World Example


Now we are ready to get the first glimpse at our “Hello World” example.
The following program is the simplest “Hello World” example. It prints
out Hello World. in the console window:
#include <iostream>

int main()
{
std::cout << "Hello World.";
}
Believe it or not, the detailed analysis and explanation of this
example is 15 pages long. We can go into it right now, but we will be no
wiser at this point as we first need to know what headers, streams,
objects, operators, and string literals are. Do not worry. We will get
there.

A brief(ish) explanation
The #include <iostream> statement includes the iostream
header into our source file via the #include directive. The iostream
header is part of the standard library. We need its inclusion to use the
std::cout object, also known as a standard-output stream. The <<
operator inserts our Hello World string literal into that output stream.
String literal is enclosed in double quotes "". The ; marks the end of
the statement. Statements are pieces of the C++program that get
executed. Statements end with a semicolon ; in C++. The std is the
standard-library namespace and :: is the scope resolution operator.
Object cout is inside the std namespace, and to access it, we need to
prepend the call with the std::. We will get more familiar with all of
these later in the book, especially the std:: part.

A brief explanation
In a nutshell, the std::cout << is the natural way of outputting data
to the standard output/console window in C++.
We can output multiple string literals by separating them with
multiple << operators:

#include <iostream>

int main()
{
std::cout << "Some string." << " Another
string.";
}
To output on a new line, we need to output a new-line character \n
literal. The characters are enclosed in single quotes '\n'.
Example:

#include <iostream>

int main()
{
std::cout << "First line" << '\n' << "Second
line.";
}

The \ represents an escape sequence, a mechanism to output


certain special characters such as new-line character '\n', single
quote character '\'' or a double quote character '\"'.
Characters can also be part of the single string literal:

#include <iostream>

int main()
{
std::cout << "First line\nSecond line.";
}

Do not use using namespace std;


Many examples on the web introduce the entire std namespace into the
current scope via the using namespace std; statement only to be
able to type cout instead of the std::cout. While this might save us
from typing five additional characters, it is wrong for many reasons. We
do not want to introduce the entire std namespace into the current
scope because we want to avoid name clashes and ambiguity. Good to
remember: do not introduce the entire std namespace into a current
scope via the using namespace std; statement. So, instead of this
wrong approach:
#include <iostream>

using namespace std; // do not use this

int main()
{
cout << "A bad example.";
}
use the following:

#include <iostream>

int main()
{
std::cout << "A good example.";
}

For calls to objects and functions that reside inside the std
namespace, add the std:: prefix where needed.
© Slobodan Dmitrović 2020
S. Dmitrović, Modern C++ for Absolute Beginners
https://doi.org/10.1007/978-1-4842-6047-0_5

5. Types
Slobodan Dmitrović 1
(1) Belgrade, Serbia

Every entity has a type. What is a type? A type is a set of possible values
and operations. Instances of types are called objects. An object is some
region in memory that has a value of particular type (not to be confused
with an instance of a class which is also called object).

5.1 Fundamental Types


C++ has some built-in types. We often refer to them as fundamental
types. A declaration is a statement that introduces a name into a
current scope.

5.1.1 Boolean
Let us declare a variable b of type bool . This type holds values of
true and false.

int main()
{
bool b;
}

This example declares a variable b of type bool. And that is it. The
variable is not initialized, no value has been assigned to it at the time of
construction. To initialize a variable, we use an assignment operator =
followed by an initializer:
int main()
{
bool b = true;
}
We can also use braces {} for initialization:

int main()
{
bool b{ true };
}

These examples declare a (local) variable b of type bool and


initialize it to a value of true. Our variable now holds a value of true.
All local variables should be initialized. Accessing uninitialized
variables results in Undefined Behavior, abbreviated as UB. More on
this in the following chapters.

5.1.2 Character Type


Type char, referred to as character type, is used to represent a single
character. The type can store characters such as 'a', 'Z' etc. The size
of a character type is exactly one byte. Character literals are enclosed in
single quotes '' in C++. To declare and initialize a variable of type
char, we write:

int main()
{
char c = 'a';
}

Now we can print out the value of our char variable:

#include <iostream>

int main()
{
char c = 'a';
Exploring the Variety of Random
Documents with Different Content
that very night. She felt that she could not meet the eyes of the
baronet, his fiancée, or Jack Rotherfield again.
The evening seemed a long one; she had to go to bed, to avoid
exciting suspicion as to her intention, which was to steal out of the
house when everybody else was asleep. But before retiring she
witnessed a sight that set her thinking. For after dinner Sir Robert
walked with Lady Sarah up and down the terrace close under
Rhoda’s window, and the girl fancied, both by the affectionate
manner in which they smiled at each other, and by the defiant half-
glances which the baronet cast stealthily up towards her window,
that he had told his fiancée of the doubts expressed as to her
sincerity, and that Lady Sarah had set him quite at rest upon that
score.
Rhoda did not sleep. At one o’clock, when all was silent in the
house, she rose, dressed herself hastily, and glided softly out of her
room and down the stairs. She had written a letter, directed to Sir
Robert, and left it in her room. She had said in it that, having had the
misfortune to offend him, she could not meet him again, but that she
begged his pardon with all her heart, and hoped that he would
forgive her, as she felt sure he would do, if he could only understand
the pain she felt at having given a moment’s displeasure to one to
whom she owed so much. She added that she would never forget
his goodness to her as long as she lived.
She had reached the hall, with the intention of leaving the house
by the front-door, and had withdrawn the bolts, when she was
startled by the sound of some one rapidly descending the stairs. She
thought she was discovered, and hastily hid herself in the dark
corner beside the tall grandfather’s clock that stood near the door.
But she had scarcely done so when she caught sight of something
which she could dimly discern to be a man, disappearing into the
drawing-room, and the next moment she heard sounds within the
room as of a scuffle and stifled cries.
Trembling and horror-struck, Rhoda was unable to decide whether
she ought to go upstairs and call for help, when, panting and drawing
deep breaths the figure stole out of the room again, shutting the door
softly.
The man was in such deep darkness and Rhoda was so far
entrenched in her corner that she could see but little of him, and that
little very dimly, until he was half-way up the stairs, when, dragging
his way up by the stair-rails, he laid his hand for a moment upon that
spot of the banisters where a single ray of moonlight fell upon them
from between the heavy velvet curtains that draped the staircase
window.
And Rhoda saw, with a shudder, that across the hand was the red
line of a cut which was still bleeding.
Before she could even be sure whether the figure was that of Sir
Robert, as she believed, it had disappeared.
Confused, trembling, wondering what it was that had happened,
Rhoda opened the front-door and slipped out, closing it softly behind
her.
She thought that she must have made enough noise for the
shutting of the door to have attracted attention, and she hoped, as
she went slowly down the narrow slip of garden which was all that
lay between the front of the house and the road, that the baronet
would come out after her, waylay her, and perhaps insist upon her
return.
But nobody came out, nobody followed her; and so, mystified, sick
with terror, and asking herself as she went whether she ought to
have come out without an effort to find out what had happened, she
went down the road towards the harbour.
She put up, for the rest of the night, at an hotel where she had
stayed before with her parents, and where travellers from off the
boats came at all times of the night, so that her late arrival attracted
no particular attention.
On the following morning she took the first train to Deal, and
reached the lodgings where her parents were in such a condition of
exhaustion that she was promptly put to bed. She insisted, however,
upon being allowed to tell her mother the singular circumstances that
had occurred at the moment of her departure from Mill-house, and
begged that they would let her know at once if it should come to her
parents’ ears that anything serious had happened that night at Sir
Robert’s residence.
For four days she was kept in bed, and assured that nothing had
happened as far as any one knew.
But when she was well enough to get up again, the truth was
gradually broken to her. The dead body of the butler, Langton, had
been found in the drawing-room, where it was evident that some sort
of a scuffle had taken place. The drawing-room window had been
found open, and it was supposed that a burglar had got in, and that
the butler, hearing a noise, had gone down and had been murdered
by the intruder.
The inquest had been held, and the verdict brought in: “Wilful
murder by some person or persons unknown.”
But the rumour about the neighbourhood was that there had been
a serious quarrel between Langford and his master, that he was
known to have been under notice to leave his situation, and that it
was in a scuffle between master and man that Langford came by his
death.
Rhoda sprang up with a cry.
“It’s not true!” she cried. “Sir Robert is incapable of such a thing!
Besides, I know! I can prove—Oh let me go and tell what I know!”
But the next moment the light faded out of her eyes and she sank
back, trembling.
What did she know? What could she prove? Nothing, nothing.
CHAPTER III.
TEN YEARS AFTER

Ten years passed before Rhoda Pembury saw Sir Robert Hadlow or
the old Mill-house again, and during those ten years all that she
heard of him or of his doings was through an announcement in the
newspapers, some six months after her stay there, of his marriage
with Sarah, third daughter of the Marquis of Eridge.
After that, although Rhoda did, from time to time, see brief
paragraphs in the papers concerning the doings of Lady Sarah
Hadlow, and incidental mention in connection with her, of her
husband, Sir Robert, she held no communication with them, or with
any of the household at the Dourville Mill-house, and she believed,
during the whole of that period, that the baronet who had saved her
life and who had been kind to her, had passed out of her life for ever.
In the meantime, having developed into a beautiful and
accomplished woman from the half-fledged girl she had been then,
Rhoda received a good deal of attention and more than one offer of
marriage.
But she cared little for admiration, and her heart was never
touched. Greatly to the annoyance of her parents, who had a large
family, and who were both eager to settle their handsome daughter
in marriage and a home of her own, Rhoda made light of all the
attentions paid to her, refused her lovers without compunction, and
announced, when reproached with her coldness and obstinacy, that
she intended to remain single through life, and that, as her parents
would never be able to get her off their hands in the way they
desired, she would meet their wishes by earning her own living.
This was not at all what they wanted, and her mother prevailed
upon Rhoda to give way on this point for a time. But the thought was
ever in the girl’s mind, and Mrs. Pembury was not surprised when,
ten years after the episode at the Mill-house, Rhoda came to her
with a newspaper in her hand, and, pointing to an advertisement in
one of the columns, said briefly:
“Mother, I’m going to answer this.”
The announcement to which she pointed ran like this:

“A lady wanted, as nurse-companion to an invalid boy.


Apply personally, if possible, at the Old Mill-house, Dourville.”

Mrs. Pembury having put on her glasses, read the advertisement,


and laid down the paper with an exclamation of something like
dismay.
“Why, it’s Sir Robert Hadlow’s, where the murder was committed!
Surely you wouldn’t go back there!”
Rhoda, who was very pale, asked briefly:
“Why not?”
But Mrs. Pembury was too much disturbed to reply. Hastily leaving
the room with some excuse, she went straight to her husband, who
was in his surgery, and laid the paper before him.
“What do you think of that?” she asked in consternation. “I’d
always had an idea it was something that happened while she was
there that prevented Rhoda’s marrying, and now I’m sure of it. I
believe she fell in love with Sir Robert’s ward, Mr. Rotherfield.”
But Dr. Pembury thought this idea high-flown and far-fetched, and
said he could not see any likelihood of such a thing. Rhoda would
have betrayed herself before this if she had nourished a passion for
so long, and in any case, it did not matter, as it was more than likely
that Sir Robert had left the Mill-house by this time, since his wife
appeared to be always in London, or, if not, that Mr. Rotherfield had
settled down somewhere else with a wife of his own.
Mrs. Pembury was troubled, but she always submitted, even
against her better judgment, to her husband’s wishes, and in this
case it was not even her judgment, but only a sort of feminine
instinct, which told her that Rhoda had strong sentimental reasons
for wishing to take this step.
On the following day, therefore, Rhoda, who was now twenty-
seven, and better capable of looking after herself than she had been
at seventeen, started alone for Dourville, and presented herself,
early in the afternoon, at the house she remembered so well.
Emotion made her eyes fill and her limbs tremble as she
approached the house, and recognised that it had undergone such
changes, since she first knew it, that she could scarcely be sure she
had not made a mistake and come to the wrong gate, when she
found herself standing before a long, white house, with wings
extending far in each direction, and with the modern big, wide
windows replacing the little narrow old ones.
Many of the trees that had surrounded the old house so closely
had been cut down, with considerable advantage as regards light,
but at a great loss of picturesqueness. Gone was the cosy, old-
fashioned look, together with the dark red curtains, the heavy square
portico, the homely look that she had loved.
It was into a stately, handsome hall that she was shown, a room
having been sacrificed to enlarge the entrance; and when she found
herself following a footman across a wide expanse of parquetted
floor to a new part of the building, and ushered into a lofty, light
library, Rhoda was almost ready to believe that she had made a
mistake, and that the Sir Robert, who would, so the footman said,
see her at once, could not be the man who had saved her life, the
memory of whose kindness she had treasured in secret for so long,
the man whose image had, almost unknown to herself, so effectually
shut out that of every other man from her heart during these ten
years.
But there he was, not indeed the Sir Robert she remembered, but
perfectly recognisable to her, although the dark hair had become
thickly streaked with grey, and the face more deeply lined than that
of a man of forty-five ought to be.
She had felt her heart beating very fast as she was led towards
the library, but she was totally unprepared for the reception she met.
She was duly announced as “Miss Pembury,” but she perceived at
once that the name awoke no memories in Sir Robert.
He had forgotten her.
In part, perhaps, the fact that he was very short-sighted, and that
he was not wearing his glasses, was answerable for his lack of
recognition, but however that might be, Rhoda felt cut to the heart
when he rose, bowed formally, and offered her a chair.
“I am sorry that my wife is away, as she would have been better
capable than I of arranging these matters with you, Miss Pembury,”
he said. “Ladies can get to the point over such things more quickly
than a mere man can hope to do. But I’ll tell you all I can, and you
will perhaps be able to judge whether you would care to come to
take charge of my boy. But perhaps you would like to see him first?
He is an invalid, as I suppose you know.”
“I should like to see him,” said Rhoda, in a low and gentle voice.
But the voice recalled no memories, and Sir Robert, ringing the
bell, told the servant to have Master Caryl’s carriage brought along
the terrace.
Rhoda was still so much under the influence of the strong
emotions called up by this meeting that she was glad there was no
need for her to say much.
On learning that she lived in London, and that she had come all
the way from the great city that morning, Sir Robert seemed
surprised, and ringing the bell again, told the footman to have some
luncheon prepared for Miss Pembury.
Rhoda protested, and thanked the baronet, who seemed already
to take it for granted that she would stay. The fact being that her
refined manner, sweet voice and sympathetic appearance had at
once predisposed the rather absent-minded gentleman in the
visitor’s favour.
A few minutes later there was a slight sound of footsteps upon the
terrace, and Rhoda, looking out, saw, with tears in her eyes, a boy
lying on a long, spinal chair, looking in at her through the window
with big, soft, dark eyes that, while they recalled in colour and
brilliancy those of his mother, had something of the far-away
expression of his father in them too.
She hastened across the floor, and bending over the boy kissed
him on the forehead.
He flushed a little, put out his hand and laid it upon hers.
“Are you coming to stay with me?” he asked simply.
“It is for you to say, dear,” said Rhoda.
He moved his head slowly and looked at her with great intentness.
“I should like it very much,” he said. “What am I to call you?”
Rhoda threw a hasty glance at Sir Robert, who was standing by
them, so intent in watching his son’s face that he took but little heed
of the visitor. So she thought she might venture to give her name
without fear of discovery. Since he had begun by non-recognition, it
was better to go on without undeceiving him, she thought.
“Call me Rhoda,” she said softly.
He smiled at her. Though he was scarcely more than eight years
old, his condition had made him older in many ways than his age,
and his manner was almost that of a grown person as he said:
“Rhoda. Yes, I like that.”
“You will stay with him then?” asked Sir Robert, evidently pleased
at the fancy the child had taken to the lady.
Rhoda hesitated. There were details to be settled, of which the
man took no cognizance. Perceiving her hesitation, he smiled, and
waving his hand, said:
“You will want to know a great many things, about hours and
holidays and—and other things. We can leave all those until Lady
Sarah comes back next week, can’t we? My housekeeper will assign
you rooms, any you care for, and you can do just as you please, as
long as you make my boy happy. He is left too much alone. His
mother doesn’t like Dourville; it doesn’t agree with her very well. I
hope it will please you, however.”
“Thank you. I shall like it, I know,” said Rhoda.
“Come and talk to me,” said Caryl, “and let me show you my
monkey, and my rabbits. I’ve got three, and some budgerigars. I
hope you like birds. And I’ve got a dog. Would you like to see him? I
want you to see him do his tricks.”
Off they went together, the lady and the child, and Sir Robert,
standing blinking in the sunshine, seemed to have, Rhoda thought, a
vague impression of having seen or heard something which the
lady’s presence recalled.
But to her regret, it was evident that the recollection was fraught
with pain.
She and the boy made the tour of the garden together, for he had
dismissed the servant, asking Rhoda if she would draw him along.
By the time they had been an hour together, moving slowly along
the shady walks, and visiting the boy’s numerous pets in rabbit-hutch
and aviary, they were already firm friends; and when they returned to
the terrace, Rhoda had the satisfaction of seeing Sir Robert standing
at the library window, with a faint smile upon his face. He was
pleased by the pleasure of his boy.
“It’s good of you to humour him by walking about so long when
you must be tired, Miss Pembury,” he said. “I have sent for Mrs.
Hawkes, the housekeeper, and directed her to have some tea for
you, and to show you your rooms.”
“Thank you very much,” said Rhoda.
She had a transient fancy that Sir Robert recalled something in her
name or in her person, for he looked at her suddenly with a slight
frown and with vague curiosity. He did not, however, ask her any
questions, and a few minutes later Rhoda was going upstairs,
escorted by the footman, towards the rooms where the housekeeper
was busy preparing for her reception.
The man threw open a door and announced:
“Miss Pembury, Mrs. Hawkes,” and Rhoda entered.
The man went away, and Rhoda heard an exclamation from the
grey-haired woman in spectacles who was drawing a cover over a
little table in the pretty sitting-room.
“Why, it’s Miss Rhoda!” cried the grey-haired woman.
The visitor exclaimed in her turn.
“Bessie!” cried she.
Neither woman could restrain her tears.
“I’m housekeeper here now,” said Bessie, wiping her eyes. “But,
oh, Miss Pembury, to think Sir Robert shouldn’t know you! And to
think of your turning up here, after all this time, and us wanting you
so bad ten years ago!”
“What do you mean?” asked Rhoda, trembling.
“Let me get your rooms ready, and get rid of the maid, who is in
the next room and who will be in here in a minute, and then I’ll tell
you everything,” said Mrs. Hawkes.
And within five minutes, the two rooms having been got ready, and
the maid dismissed in search of tea and sandwiches for Miss
Pembury, the two old friends sat down in the window-seat together,
and the housekeeper began her story.
CHAPTER IV.
RHODA RETURNS TO MILL-HOUSE

“Ah, Miss Pembury, there’s been a many changes since the night
when you ran away from here!” she said, as she sighed and folded
her hands in her lap. “But why did you go so quick and so quiet? And
why didn’t you come forward when the inquest was held?”
“I—I went away because I’d displeased Sir Robert,” said Rhoda.
“So that I couldn’t bear to meet him again. And as for the inquest, if
you mean that on the poor butler, I never heard anything about it till
long after it was over. I fell ill, you know, and they wouldn’t let me
know anything.”
Mrs. Hawkes nodded.
“I know that was what they said, but we all thought that it was only
an excuse, and that the truth was you didn’t want to come forward,
because you knew too much.”
“Too much!” faltered Rhoda.
“Yes. By the time you were missed, and by what we heard of your
arriving at the hotel where you stayed the night, we thought as how
you couldn’t but have heard or seen something of the murderer of
poor Langton.”
Rhoda trembled at the recollection.
“Who was the murderer?” she asked in a whisper.
The housekeeper shook her head.
“Nobody knows from that day to this,” she answered. “The inquest
was held, after being put off, and they brought it in ‘by some person
unknown.’ But people talked, and it was very unpleasant for us all.”
“What did they say?” asked Rhoda hoarsely.
The housekeeper closed the window, and went to the door, looked
out and came back again.
“These aren’t things one likes to talk about, even now,” she said.
“Of course the thing was really clear enough. It was a thief tried to
rob the house, did get in a little way, and poor Langford went down
and struggled with him and got killed.”
“How was he killed?” asked Rhoda.
“He must have been flung down into the fireplace with so much
force that it killed him, they said. He was found with his head in the
stone fireplace, covered with blood and dead. Fractured skull, the
doctors said he died of. But his hands were gashed as if he’d been
struggling with some one for a knife.”
Rhoda was listening, in a state of stupefaction with horror. But she
would not betray herself. Sitting very still, with her head bent, she
listened.
The housekeeper went on:
“No knife was found, and though they saw some footsteps coming
to the house, they found none going away again. That was odd and
mysterious. Especially,” the housekeeper looked round her again,
and dropped her voice, “as Sir Robert had been out in the grounds
very late.”
“Sir Robert!” echoed Rhoda, appalled.
Mrs. Hawkes nodded.
“That was the part of it that made us all uncomfortable,” she said,
below her breath. “And that was why they wanted you to come
forward. And you would have had to come, only your father said you
knew nothing about it at all, and that it would have endangered your
life to have had to come.”
“Oh!” gasped Rhoda.
“For everybody thought even more than they said. Everybody
wanted to know if you had seen anybody.”
She paused, and tried to look into Rhoda’s face. But the girl kept
her head obstinately bent. Not for the world would she have had the
nurse see the look of horror which she felt there must be in her own
eyes.
It was not that she thought that Sir Robert had killed his servant:
not for one moment would she have admitted such a possibility. But
she could herself have borne witness to the fact that some one did
go upstairs after the struggle in the drawing room.
Who could it have been?
“There was lots of talk and idle gossip,” went on Mrs. Hawkes.
“And even after the verdict was given, the talk went on just the same.
You see it was known that nobody had any quarrel with Langford
except the master, and it was known that Langford had had his
notice, though why he got it was not rightly known.”
There was a pause, but still Rhoda refrained from asking any
questions.
“And it never has been known,” added the housekeeper solemnly,
“from that day to this.”
“I couldn’t have said anything to help,” said Rhoda at last in a
stifled voice.
“Didn’t you see anything, or hear anything then?”
“Yes. I heard a noise in the drawing-room,” admitted Rhoda, “and I
went out by the front door.”
“Yes, we knew that, for some one heard it shut. And that was one
reason why we thought you must have known something.”
Rhoda suddenly sat up.
“Surely,” she said sharply, “nobody was so foolish and wicked as
to think that Sir Robert, the best man in the world, had anything to do
with it?”
The housekeeper answered quickly:—
“Of course we, who knew him, didn’t think so. But there were
plenty of unkind things said outside, you may be sure, miss.”
“How shocking!”
“And folks thought as the marriage would be broken off, for the
Marquis was a good deal cut up about the gossip. But then Lady
Sarah she stood up like a high-minded lady, and she said as how
she didn’t allow such foolishness to disturb her for one moment. And
she married him, and even married him the sooner for the talk.
Which was handsome of her, and which Sir Robert he thought the
world of in her, you may be sure.”
Rhoda nodded. From what she had seen of the flippant and
vivacious flirt she wondered whether high-mindedness was really the
quality to which Sir Robert owed her steadfastness.
There was a pause, and Mrs. Hawkes gave a deep sigh, which
made Rhoda look at her, and perceive that an expression of the
deepest disappointment was on the good woman’s features.
“I was in hopes as you would be able to tell something, something
that would have cleared things up, miss,” she said.
Rhoda’s eyes filled with tears, while a hot blush rose to her
cheeks. It was quite true that she did know something, just a little
more than anybody else appeared to know, about the doings of that
fatal night. But as it was nothing definite enough to absolve anybody
or to convict anybody, she felt that wisdom lay in keeping that little to
herself, for the present, at any rate.
“And so Lady Sarah was staunch, and earned Sir Robert’s
gratitude?” she said, her constraint making her words sound rather
stiff.
Mrs. Hawkes looked enigmatic for a moment, and then came a
little closer.
“Seeing you know so much about them, I may tell you, in
confidence, that it’s not been as happy a marriage as, from such a
beginning, one might have hoped,” she said. “You see it was a
disappointment there being only the one child, this poor boy that
never was strong. And then, well, Lady Sarah’s tastes and Sir
Robert’s they don’t seem to go well together. So my lady’s most
often away, either in town or abroad for her health, and Sir Robert,
he don’t seem to care to leave his house and his boy that he loves
so much.”
“And doesn’t Lady Sarah care for her boy too?”
The housekeeper’s face altered a little in expression.
“Of course she does,” she replied diplomatically. “But there’s
different ways of caring, and the sight of him with his little couch and
his spinal chair, well, it hurts my lady, who would have liked to have a
boy handsome and tall and strong.”
Rhoda felt chilled.
“It’s a pity she ever married Sir Robert,” she cried impulsively.
The housekeeper looked rather shocked.
“Well, miss, he wouldn’t let her be till she’d promised him, he was
so much in love,” she said quickly. “And anyhow, he’s pleased his
fancy. He married the lady he liked best.”
“Yes.”
Another question was on Rhoda’s tongue, but it was one she was
shy of uttering.
It took a different form from the one at first in her mind when at last
she said, timidly:
“Is Mr. Rotherfield married?”
Mrs. Hawkes looked at her quickly.
“No, he’s not married,” she said slowly. “I think he’s in love too
often to fix upon any one lady.”
There was something in her face that prevented Rhoda from
asking any more questions on that subject. Indeed, Mrs. Hawkes
was not prepared to answer any more, for she changed the subject
and said: “Do you remember the two children who were here at the
time of your accident, miss?”
“Why, yes, of course I do. George and Minnie. What has become
of them? The Terrors you used to call them.”
“And the Terrors they are still,” said Mrs. Hawkes emphatically.
“They’re away now; Master George he’s at Sandhurst, and Miss
Minnie she’s staying in Normandy with friends for the summer
holidays. But they live here still, and I don’t say I’d be without them,
though their battles with my lady don’t give one much peace.”
“Battles?”
“Yes, they’re just what they always were, and the plague of all our
lives.”
“I wonder whether they’ll recognise me!” said Rhoda.
“Trust them for it!”
“But Sir Robert doesn’t.”
Mrs. Hawkes looked at her.
“Well, there’s no need to be astonished, for he’s so short-sighted,
and he lives so much shut up with his books and his collections, that
he hasn’t much memory for anything else. He’s taken to collecting
since you were here, miss, and he’s got a gallery of pictures that
people come for miles to see. That’s what the north wing was built
for, to put them in. And the south wing, that was for my lady’s
dances. Not that she gives many of them now.”
There was a little constraint on both sides now that Rhoda had
confessed that Sir Robert had failed to recognise her. Mrs. Hawkes
looked disturbed. At last she said:
“I was wondering, if I may make so bold as say so, miss, whether
Sir Robert would let you stay here again, if he was to remember
you.”
Rhoda looked startled and uneasy.
“Why should he mind?” she asked quickly.
“Oh, only that he doesn’t in general like to be reminded of that
time. And if he had recognised you, he couldn’t but have thought of
it, could he?”
“N-no,” said Rhoda, beginning to feel nervous.
There was another silence, and then Mrs. Hawkes ventured:
“Would it be taking too great a liberty, miss, to ask how you came
to want to come back here, after all these years? For you must have
remembered too, what happened, and have felt uncomfortable about
it, I should think?”
Rhoda blushed hotly.
“Of course I knew what happened, through the newspapers and
what I was told,” she said. “But I didn’t think it could matter. How
should it? I didn’t know anything.”
“No, miss.”
Mrs. Hawkes looked down again.
“May I venture to ask whether you found the master altered,
miss?”
Rhoda’s lips trembled a little as she replied:
“Yes, I did. He doesn’t look so young, of course, as he did then.”
“Nor so happy,” suggested the housekeeper almost under her
breath. “And do you still think him as handsome as you did?”
Rhoda tried to laugh.
“You want to know, I suppose, whether I still feel the infatuation I
felt then about him?” she said. “Of course I don’t. It was a young
girl’s childish fancy. But I do think he is a most sympathetic, kindly
natured man, and I should be very glad, considering what my
obligations are to him, if I could be of any use in taking care of his
child.”
She was wondering, as she spoke, what Lady Sarah would say
when she found her installed at the Mill-house. Until that moment,
strange to tell, she had felt no curiosity on this point; it was only now,
when she saw the view the housekeeper took of her coming, that
this question suggested itself to her. However, there were some days
to pass before Lady Sarah would return from abroad, and in the
meantime Rhoda might pass her time very happily with the child, she
thought.
And so it fell out. Within a few minutes her tête-à-tête with the
housekeeper was interrupted by a message to the effect that Master
Caryl wanted to see her, wanted to know whether she would have
tea with him, and Rhoda, hastily divesting herself of her hat, went
downstairs to the boy’s room, where she found him, flushed and
eager, awaiting her coming and welcoming her with a cry of delight.
The next few days were among the happiest she had ever passed.
Caryl was a charming companion, affectionate, docile on the whole,
though somewhat spoilt. He had taken a great fancy to Rhoda, and
would not leave her much time to herself, while Sir Robert, delighted
at his son’s finding an interest in life, overwhelmed her with signs of
his appreciation.
Rhoda wondered sometimes whether he did not begin to
remember her; for she would find him regarding her as it were by
stealth, with a frown of pain upon his face, and although he asked no
questions, she felt sure that he must already be wondering whether
he had not met her before.
To Rhoda the sadness in his quiet face was infinitely touching, and
little by little she found ways of making herself useful to him, by
copying the notes he had made concerning his curios, as well as by
letting him talk to her concerning them.
“It’s very good of you to let yourself be bored, Miss Pembury,” he
would say to her with a shy laugh when he had been expatiating
upon the beauties of his enamels or of his old Sèvres china. “When
Lady Sarah comes back, she will say that you have spoilt me. I’m not
used to having my dull dissertations listened to with so much
appearance of interest. And I’m quite sure,” he added archly, “that it
can’t be more than an appearance.”
“Indeed I wouldn’t pretend to be interested if I were not, Sir
Robert,” Rhoda assured him humbly and earnestly.
And she told the truth. She would not, indeed, have found the
pictures and curios so intensely interesting as she did, if they had not
belonged to the man who had once saved her life. But for his sake
she liked them, and her sympathy delighted the grave and rather
lonely gentleman.
He was profusely grateful to her for the pains she took in collecting
and copying his notes, and in sorting his papers for him. And he said
to her with intense appreciation, one day when she had succeeded
in deciphering some of his notes which he himself could not read:
“Miss Pembury, if you hadn’t come here as companion to my boy, I
should have had to keep you here as my secretary.”
He could not guess the pleasure the simple words gave to the
sensitive and grateful Rhoda. She had to pause a moment before
she could reply with calmness:
“I wonder you have never before thought of having a secretary, Sir
Robert.”
He shook his head.
“I wouldn’t have one for worlds,” he answered with decision,
“unless I could get one to undertake the duties of free will. What! To
have a professional secretary fingering my papers, and handling my
treasures coldly, because it was his or her duty to do it!” And with a
little playful assumption of horror, he added: “Do you know, I really
think it would injure the pictures and the china too, to be subjected to
the perfunctory care of some one specially engaged to look after
them? No. I’m fanciful about my treasures. Whatever work is done in
connection with them, must be done for love.”
The ingenuous words struck a responsive chord within the breast
of Rhoda, and she did not say a word.
But the implied compliment to her thoughtful help was treasured
up in her heart, and it made her happy for the day.
Lady Sarah’s return was delayed for a week, so that, when at last
Mrs. Hawkes received word that she was to prepare her rooms,
Rhoda had been a fortnight at the Mill-house, and was already
feeling quite at home.
She spent the day between Caryl and Sir Robert; very often now,
indeed, Caryl would insist upon her taking him into his father’s study,
where he would lie in a corner watching Rhoda while she deciphered
notes and copied inscriptions.
Sir Robert began to entrust more and more of his work to her,
always prefacing any request with a humble apology for taking up so
much of her time, and always receiving the quiet assurance that
what he asked her to do was just what she had been wishing herself
that she might do.
Caryl, his father said, was happier than he had ever been before.
“You fill just that place to him,” said Sir Robert enthusiastically, one
evening, “that I had always hoped would be filled by my niece
Minnie. But of course you don’t know her, so you don’t understand.”
Rhoda remained silent. She did know Minnie, and she knew, too,
how hopeless it would have been to expect quiet sympathy from that
young lady, if she had fulfilled her childish promise and grown up the
mischievous torment she seemed to be inclined to develop into.
It seemed almost tragic to Rhoda that, while speaking thus of his
niece, he left out all mention of his wife, who would have seemed to
be the boy’s natural companion.
“You’ll be very, very glad to see mama again, won’t you, Caryl?”
Rhoda asked that evening, when he had been put to bed and she
was bending over him to bid him good-night.
“It doesn’t make so much difference to me whether she’s here or
not,” replied the child, in the quaint, old-fashioned way children have
who see few playfellows or companions of their own age.
Perhaps Rhoda looked rather shocked. So the boy added:
“Mama is not like you. She likes to be out in her motor-car all day,
or playing tennis or dancing. She isn’t quiet, like you.”
“She will have brought you something pretty, I expect,” suggested
Rhoda.
“Oh, yes, but she never brings the things that I like,” complained
Caryl. “What I want is a book full of pictures of hunting. I know she
won’t bring me that.”
Rhoda was struck with the pathos of this wish. For poor little Caryl,
condemned to lie on his back and unable to run about and play like
other children, had a passion for sport of all kinds, and was never
happier than when watching a cricket or a football match; and even
now, in early September, he was talking eagerly about the fox-
hunting season, and asking Rhoda if she would take him to a meet
of foxhounds when cub-hunting began.
She had begun by this time to dread Lady Sarah’s return, to
wonder whether her presence at the Mill-house would be resented
by the flighty beauty, who would certainly remember her, and who
might perhaps look upon her as an interloper, and be jealous of the
help she gave to Sir Robert and of the love which little Caryl had
already bestowed upon her.
It was the next day that the mistress of the house was to arrive
and Rhoda was now on thorns. In the old days, indeed, Lady Sarah
had scarcely spoken to her, but she might not look upon her with the
same indifference now.
For Rhoda was conscious that there were whispers abroad
concerning herself; and she guessed that, although the whole of the
household, with the single exception of Mrs. Hawkes, was changed
since she was there last, the housekeeper must have told some of
the servants about the bicycle accident and the flight of Miss
Pembury on the night of the tragedy at the Mill-house, and that there
was a certain curiosity abroad concerning her.
It was late in the day when Lady Sarah arrived, and coming up to
the bedroom of her little son when he had retired for the night, found
Rhoda in the room.
Rhoda, however, regretting that she should have been found
there, and fearing that Lady Sarah would think she was trying to take
the mother’s place already with the boy, kept in the background, and
witnessed, unremarked by Lady Sarah, the meeting between mother
and son.
“Well, Caryl, and how are you?” cried she, as she bent over him
and gave him a light kiss on the forehead. “They tell me you’ve been
getting on famously and that you’ve got an awfully nice companion
now.”
“Yes. I love Rhoda, and so will you, mama. Rhoda, come here.
You shall see her, mama,” cried the boy in excitement.
Lady Sarah stood up and Rhoda had a good view of her. She saw
that the ten years which had passed since she met her first had only
served to ripen her beauty. Lady Sarah, though not quite so slim and
slender, so like a fairy as she had been in the days of her girlhood,
was lovelier than ever. Her dark eyes were just as bright, her
complexion was as brilliant, while a little dignity of manner now
added to her charms.
She held out her hand graciously, and Rhoda came forward.
But the moment she came within the range of light thrown by the
shaded electric lamp on the table at the foot of the bed, Lady Sarah’s
face changed. A look of intense horror appeared in her face, and her
hand dropped, as she met Rhoda’s eyes with a startled look, and,
recognising her at once, said hoarsely, under her breath:
“Miss Pembury!”
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!

ebooknice.com

You might also like