Download Cracking C Programming Interview 500 interview questions and explanations to sharpen your C concepts for a lucrative programming career English Edition Jhamb ebook All Chapters PDF
Download Cracking C Programming Interview 500 interview questions and explanations to sharpen your C concepts for a lucrative programming career English Edition Jhamb ebook All Chapters PDF
com
https://textbookfull.com/product/ace-the-programming-
interview-160-questions-and-answers-for-success-1st-edition-edward-
guiness/
textbookfull.com
https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-programming-interview-guide-first-edition-hemant-
jain/
textbookfull.com
https://textbookfull.com/product/problem-solving-in-data-structures-
algorithms-using-c-programming-interview-guide-1st-edition-hemant-
jain/
textbookfull.com
https://textbookfull.com/product/economic-integration-and-regional-
development-the-asean-economic-community-1st-edition-kiyoshi-
kobayashi/
textbookfull.com
Configurations, Dynamics and Mechanisms of Multilevel
Governance Nathalie Behnke
https://textbookfull.com/product/configurations-dynamics-and-
mechanisms-of-multilevel-governance-nathalie-behnke/
textbookfull.com
https://textbookfull.com/product/bodyweight-strength-
training-12-weeks-to-build-muscle-and-burn-fat-1st-edition-jay-
cardiello/
textbookfull.com
https://textbookfull.com/product/the-sky-atlas-the-greatest-maps-
myths-and-discoveries-of-the-universe-1st-edition-edward-brooke-
hitching/
textbookfull.com
https://textbookfull.com/product/preservation-and-reuse-design-for-
fragile-territories-settlements-the-anipemza-project-francesco-
augelli/
textbookfull.com
https://textbookfull.com/product/the-palgrave-handbook-of-workplace-
innovation-adela-mcmurray/
textbookfull.com
Organization Theory & Design: An International Perspective
Richard L. Daft
https://textbookfull.com/product/organization-theory-design-an-
international-perspective-richard-l-daft/
textbookfull.com
Cracking
C Programming
Interview
www.bpbonline.com
Copyright © 2022 BPB Online
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor BPB
Online or its dealers and distributors, will be held liable for any damages caused or
alleged to have been caused directly or indirectly by this book.
BPB Online has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, BPB Online cannot guarantee the accuracy of this information.
ISBN 978-93-89845-587
www.bpbonline.com
Dedicated to
To All Computer Engineers
About the Author
Tanuj Kumar Jhamb is holding experience of working with world
top IT companies. He is currently working as a Software Engineer
with Arista Networks. Prior to that he has worked as a Software
Developer Engineer-II at Amazon, System Architect at Huawei, and
Senior Software Developer at Oracle Incorporation. He is well versed
in solving challenging real world data structure problems, and
system design patterns. He completed Master’s in Computer Science
in 2015 from NIT Calicut. He got AIR 416, Percentile 99.81 in Gate-
2013 exam in first attempt. Last but not least he has been teaching
data structure and algorithms to gate aspirants in prestigious
coaching institutes since 2014.
About the Reviewer
With more than 21 years of experience in academia and industry,
Dr. R Rajkumar is currently working at RNS Institute of
Technology, Bengaluru as Associate Professor. He has a vast
experience in teaching and mentoring both undergraduate and
postgraduate students with subjects like Computer Organization,
UNIX and C Programming, Database Management Systems, Digital
Communication, Internet of Things, Java Programming, etc. He has
several publications in refereed journals on Deep Learning
techniques. His current area of interest is Optimization of Algorithms
for Data and Intelligent Systems.
Acknowledgement
I would like to express my special thanks of gratitude and deep
regards to Mr. Mahipal Singh Parmar for sharing his software
technical expertise, and vast conceptual knowledge of coding. I
could have never completed this book without Mahipal’s valuable
and constructive suggestions.
I would like to thank a few more people Mr. Lalit Kumar, Mrs. Madhu,
Mr. Kuldeep Kumar, Mrs. Ridhi, Mrs Jyotsna, Mr Pratap Singh, Mrs
Basanti, Mr Harsh Kumar, Mrs. Smriti, and Mr Chandan Kumar for
their continued and ongoing support they have given me during the
writing of this book.
My gratitude also goes to the team at BPB Publications for being
supportive enough to provide me enough time to finish the book and
allow me to publish the book. I want to thank Dr. R Rajkumar, Mr.
Ravi Kumar Pedappu for reviewing the book.
Preface
The best way to learn new things is to do things. There are lots of
concepts in C programming that are not easily available either on the
internet or in textbooks. We tried our best to deliver concepts
through explanations of C questions. Each and every question has a
concept behind it. These concepts are damn important for students
who are planning to appear for any multinational IT company job.
Every company needs programmers/coders who are good with logic
and sound in fundamentals. This book is proved a diamond for
genuine C programmers and for serious job seekers. The book
contains more than 500 C programming questions. You only need a
maximum of 25 days to complete the book. The guidelines for
reading this book are given below. We recommend you to follow
these guidelines and try to finish the book before the deadline. At
the end of each group, some other important interview questions are
present. Try to write programs and execute . If you are having a lack
of time and good programming skills then try to write at least an
algorithm or pseudocode for them.
All C codes are compiled and executed with gcc 4.8.2 compiler driver
running on a Linux system with kernel 3.13.0-32-generic under
ubuntu-14.04 32-bit Operating system. We also recommend you to
execute the given codes in your system for better understanding and
let us know if there is any correction.
Prerequisite
3)
3 Group-2 Questions 1)
2)
3)
4 Group-3 Questions 1)
2)
3)
5 Group-4 Questions 1)
2)
3)
6 Group-5 Questions 1)
2)
3)
7 Group-6 Questions 1)
2)
2)
8 Group-7 Questions 1)
2)
3)
9 Sample Paper-1
10 Sample Paper-2
11 Sample Paper-3
12 Sample Paper-4
13 Sample Paper-5
Coloured Images
Please follow the link to download the
Coloured Images of the book:
https://rebrand.ly/zlis9i8
We have code bundles from our rich catalogue of books and videos
available at https://github.com/bpbpublications. Check them
out!
Errata
We take immense pride in our work at BPB Publications and follow
best practices to ensure the accuracy of our content to provide with
an indulging reading experience to our subscribers. Our readers are
our mirrors, and we use their inputs to reflect and improve upon
human errors, if any, that may have occurred during the publishing
processes involved. To let us maintain the quality and help us reach
out to any readers who might be having difficulties due to any
unforeseen errors, please write to us at :
[email protected]
Your support, suggestions and feedbacks are highly appreciated by
the BPB Publications’ Family.
Did you know that BPB offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade
to the eBook version at www.bpbonline.com and as a print
book customer, you are entitled to a discount on the eBook
copy. Get in touch with us at: [email protected] for
more details.
At www.bpbonline.com, you can also read a collection of
free technical articles, sign up for a range of free newsletters,
and receive exclusive discounts and offers on BPB books and
eBooks.
Piracy
If you come across any illegal copies of our works in any form
on the internet, we would be grateful if you would provide us
with the location address or website name. Please contact us
at [email protected] with a link to the material.
Reviews
Please leave a review. Once you have read and used this book,
why not leave a review on the site that you purchased it from?
Potential readers can then see and use your unbiased opinion
to make purchase decisions. We at BPB can understand what
you think about our products, and our authors can see your
feedback on their book. Thank you!
For more information about BPB, please visit
www.bpbonline.com.
Table of Contents
1. A Touch To C
Historical Perspective
Structure
Objective
Introduction to the C Program
Execution of the C program
Memory management and organization of the C program
Types of Error in C
Assumptions
Other C Programming Important Aspects
Conclusion
Key terms
Try yourself
2. Group-1 Questions
Group-1 Explanations
3. Group-2 Questions
Group-2 Explanations
4. Group-3 Questions
Group-3 Explanations
5. Group-4 Questions
Group-4 Explanations
6. Group-5 Questions
Group-5 Explanations
7. Group-6 Questions
Group-6 Explanations
8. Group-7 Questions
Group-7 Explanations
9. Sample Papers
Sample Paper - 1
Sample Paper - 2
Sample Paper - 3
Sample Paper - 4
Sample Paper - 5
References
Index
A Touch To C
Imagination is more powerful than knowledge.
Historical Perspective
Structure
In this chapter, we will cover the following topics:
Objective
Introduction to the C Program
Execution of the C Program
Memory management and Organization of the C Program
Types of Error in C
Assumptions
Other C Programming Important Aspects
Conclusion
Key terms
Try Yourself
Objective
The intention of this chapter is to get an understanding about the
anatomy of the C program which will help in unhiding the
abstraction (hidden details) about the C program. It will help the
readers visualize the running of C program, which is called Process
in terms of operating system. This chapter also explains the types of
errors which are mostly unclear for beginners/intermediate
programmers.
A simple C code
Each and every character has its corresponding integer value. For
example, the first character ‘#’ has a value of 35, the second
character ‘i’ has a value of 105, and so on.
Execution of the C program
Execution refers to using system resources like CPU, memory, I/O
devices in order to complete a particular task. For the execution of
hello.c program, it needs to use all these resources like CPU for
processing, I/O device- monitor for displaying the result "hello India"
and so on.
The issue is that the source program we have written, hello.c is not
understandable to the machine. It needs some more effort. The
given program is written in human-readable form (high level) and
the machine could not understand this. So, hello.c needs translation
from high-level form to low-level form (machine understandable).
This translation can be done using a compiler or interpreter.
The process of compilation depends on the compiler we are using,
some of the compilers are Turbo C, Dev-C, GCC, etc. Their
translation process is entirely different. The compiled file is referred
to as executable object files. On a Unix system, the execution of a C
program can be done using GCC compiler as follows:
unix> gcc -o hello hello.c
The source file hello.c is read by GCC compiler driver which
translates it into an executable object file.
unix> ./hello.
The loader loads this executable file into the main memory, and the
CPU will start processing.
The translation using GCC is not a single phase thing. The GCC
passes the source program to its four components: (i) preprocessor,
(ii) compiler, (iii) assembler, and (iv) linker. They are altogether
referred to as a compilation system. Figure 1.2 will give a better idea
of the compilation system as follows:
Figure 1.2: The compilation system
“Ay, marry, would that we but had them in the field, indeed,” replied
Hotspur; “the very smell of battle hath a marvellous virtue in it, and
doth oftentimes convert the veriest dolt into a hero. Of such fellows
as these men, one might make rare engines for recovering a lost
pennon, yea, as of finer clay. Would we but had them fit the proof.
But a plague upon these cautious seniors of the council, methinks
my patience was miraculous; nay, in truth, most miraculous, to hear
that old driveller talk of my paltry pennon, and not to dash my
gauntlet in his teeth for the word.”
“Nay, I could hardly keep my hands down,” cried Sir Rafe Piersie.
“Methinks our blood must be cooling, or else even his age should
have been no protection.”
“’Tis better as it is, Rafe,” replied Hotspur; “but why tarry these
scouts of mine? I shall fret me to death ere they return. Why are we
not blessed with the power of seeing what doth pass afar off? Had I
this faculty, how would mine eyes soar over the Douglas and my
pennon!”
In such talk as this the brothers wasted great part of the night. The
impatient Hotspur was kept in suspense until next morning, when,
much to his relief, the arrival of the wearied scouts was announced
to him. He ordered them instantly into his presence, and having
closely interrogated them, he soon gathered from them all the
intelligence he wanted.
“Frozen heads, didst thou say, Sir Harry Piersie?” demanded the
Seneschal of York calmly; “methinks that thy meaning would be to
accuse those frozen heads of being leagued with frozen hearts; but
let me tell thee, Hotspur, where snow is shed on the poll we may
look for a cool judgment; and if a cool, then probably a wise
judgment.”
“Pshaw!” said Hotspur, half aside to his brother; “this fusty utterer of
worn-out saws and everyday wisdom goadeth me beyond all
bearing; yet must I temper mine answer. Trust me, I meant not to
impeach thine ordinary judgment, Sir Seneschal,” continued he
aloud, “though I do think that it did for once err grievously in our
yesterday’s council. But let us not talk of this. I am now here to tell
ye, gentlemen, that, by the faith I owe to God, and to my Lord my
father, go who list with me, I shall now go seek for my pennon, and
give Lord Douglas the camisado this night at Otterbourne; yea, by
St. George, though I should do it without other aid than that of my
brother Rafe, and the faithful vassals of the Piersie. What, am I to
put up, think ye, with the loss of my pennon, and the disgrace of our
house and name? By heaven, though it were but a hair’s-breadth of
the hem of my Lady’s mantle, the Douglas should not carry it into
Scotland. But if disgrace doth attend the losing of Hotspur’s pennon,
depardieux, let it be borne by those who, calling themselves his
friends, will not yield him their help to retake it; for Hotspur is
resolved to wipe off shame from himself[439]—he will follow his
pennon to the Orcades, yea, pluck it from their most northern cape,
or fall in the attempt. Disgrace shall never cleave to Hotspur.”
“No, nor to Rafe Piersie neither,” cried his brother. “Let those who
fear to follow stay at home. We shall on together, hand in hand, and
seize the pennon, though grim death held its shaft; yea, paltry as it
may be thought, it shall be the sun on whose beams our dying eyes
shall close. Let us on then.”
The loud murmurs of applause which arose from among the younger
knights manifested how much they sympathized with the feelings of
the Piersies. But the old Seneschal of York again put in his word of
prudence.
“A shred of silk and gold!” exclaimed Sir Walter de Selby. “What, dost
thou not think that all England is disgraced by this triumph of the
Scottish Douglas over the Hotspur? And dost thou regard nought but
the shred of silk and gold? Talk not of the old ones, I pray thee, Sir
Seneschal of York. Trust me, old as is Sir Walter de Selby, he shall
never rest idle whilst gallant deeds are adoing to wipe off a foul
stain from the name of England. Be it death or victory, he shall have
his share on’t.”
“Thy hand, my brave old soldier,” cried both the Piersies at once.
“Nay, then,” said the Seneschal of York, “thou shalt see, Sir Harry
Piersie, that albeit I do advise caution, yet shall I do my part as well
as others, when my words do cease to avail aught; yet would I fain
have thee tarry until thou art joined by the Bishop of Durham, who
is looked for with his force this night.” [440]
Hotspur’s call was hailed with loud approval, and the brave though
cautious Seneschal, seeing that it was in vain to urge more, joined
heartily with the rest in getting the army under arms, and in
hastening the march.
The Scots had begun to sound their bugles at an early hour that
morning, and to assault the Castle of Otterbourne, and they wasted
the whole of the day in unsuccessful attempts against it. A council of
war being held in the evening, it was found that there were cautious
heads among the Scotch as well as among the English knights.
Some of those who spoke were of opinion that they should abandon
all further attempts against the Castle, and march forward towards
Scotland. But the Earl of Douglas opposed this.
The old and the cautious hardly in secret approved this counsel; but
so much was the heroic Douglas the idol of all, that his wishes were
of themselves enough to determine the resolution of those who
heard him. Measures were accordingly taken for securing the army
against surprise, and for rendering their camp as strong as
circumstances would allow; and seeing that they were to remain for
so much longer a time than they at first imagined, the soldiers
hastily threw up huts, composed of sods and branches of trees, to
give them better shelter. The baggage-wains and baggage, with the
wainmen, sutlers, and other followers of the army, were stationed so
as to block up the approach to the camp; and their position was so
defended by [441]morasses and woods, flanking it on either side, as
to render it almost unassailable. At some distance from this, the
troops were encamped on the slope of a hill, and the wooded rising
grounds on either hand contributed to form defences which left it
open to attack nowhere but in front, and even there only after the
outwork formed by the baggage at a distance in the meadow below
should be broken through.
Earl Douglas said little to those around him, but made his various
dispositions with the cool and skilful eye of an expert commander.
He surveyed the ground with thoughtful attention, as the sun was
setting bright on the hill. It glanced upon Piersie’s pennon, that
fluttered as if idly impatient of its captivity beside the large banner
of Scotland, the heavy drapery of which, drooping to the ground in
ample folds, hung in silent and majestic dignity, unruffled by the
gentle evening breeze. He thought on the Hotspur and his threats—
on the violence and impotence of man’s passions—on the actual
insignificance of the object which had so stirred up himself and
Harry Piersie, compared with the number and value of the lives of
those who might soon be called on to fight for it to the death. He
mused on the peaceful quiet that now hung over the scene, and of
the change that in a few short hours it might undergo; on the
change, above all, that might affect many of those brave hearts
which were now beating high with the pulses of life, eager to return
to their native soil, and to fulfil schemes of future happiness, never,
perhaps, to be realized.
“There is something solemn and grand in the stillness of this lovely
evening,” said the Douglas at last to the Earl of Moray, who was with
him. “The parting radiance of day in yonder western sky might make
us fancy that the earth was yblent with heaven. Why might we not
pass to that long-wished-for country on those slanting rays of glory,
without intervening death, or the penitential pains of purgatory?”
“I will tell thee,” said Douglas gravely. “I know not why it is, but my
memory hath been at this time visited by the recollection of a
strange dream I once had, and which, long forgotten, doth now
arise to me afresh with all its circumstances. Methought I was sitting
on a hill side, when, all at once, I beheld a furious battle on the plain
of the valley below. One side was led by a figure the which I was
conscious bore striking resemblance to mine own. He rushed to the
fight, but was quickly [442]pierced with three lances at once, and fell
dead on the field. Dismay began to fasten on his army, and defeat
appeared certain, when the dead corpse of the knight arose, and,
towering to a height ten-fold greater than it had when alive, moved
with the solemn step of the grave towards the foe. The shout of
victory arose from those who were about to yield, and their enemies
were dispersed like chaff before the wind, when the giant figure and
all vanished from my fancy’s eye.”
“Nay, Douglas,” said Moray, again interrupting him, “I well wot that
those grave sayings of thine are anything but the offspring of a
quailing heart; I know that they are begotten by thy dauntless and
well-grounded courage that doth accustom itself to survey death at
all times, in thought as well as in field, till thou has converted his
grim image into the familiar figure of a friend. Yet why should such
thoughts find harbour with thee now? Harry Piersie, if he do come at
all for his pennon, will hardly be here to-night.”
“I think not of the Piersie,” said Douglas, taking Moray’s hand, and
warmly pressing it between his, while a tear glistened in his manly
eye, “I think not of the Piersie or his pennon; but promise me now,
when mine hour hath come, and I shall have gloriously fallen in
battle, as I well trust may be my fate, that thou wilt yield thine
especial protection, and thy love and cherisaunce, to my widowed
Margaret. I need not tell thee what she hath been to me. Our
brother-in-law Fife is cold, and calculating, and politic, yea, and
heartless. He doth aim at the Regency, and he will doubtless gain his
end. Margaret is his much-loved sister while she is the proud wife of
Douglas; but trust me, little of her brother’s sunshine will fall upon
her widow’s weeds. Be it thine, then, to be her prop and comfort. I
well know that the warmth of thy Margery’s love will go hand in
hand with thee. I am a man, Moray—we are both men—why should
we be ashamed of a few tears shed at a moment like this?”
“Nay, but Douglas, why shouldst thou talk thus?” said [443]Moray.
“Fate may call for my life first, and then thou wilt have those duties
to perform for Margery the which thou dost now claim from me for
her sister.”
“Nay,” replied Douglas, with ominous seriousness of aspect. “Yet be
it so,” said he, after a pause; “do thou but listen to my sad humour.
Mine attached Lundie doth well deserve thy care; see that he do
meet with that advancement his piety to God and his devotion to me
hath so well merited. And then as for my gallant Archibald, my brave
esquires Hart and Glendinning, and my faithful shield-bearer Hop
Pringle, they have already carved out a shining reputation for
themselves; yet do thou never let it be forgotten that they have
been faithful followers of the Douglas.”
“Canst thou believe that the name of Douglas can ever lose its
potent charm?” exclaimed the Earl of Moray with energy, yet deeply
affected; “or canst thou doubt that to me thy will must ever be a
sacred law? But why should we now talk of matters so sad?”
continued he, endeavouring to rally his own spirits as well as those
of Douglas; “the banquet doth abide us in thy pavilion yonder, and
the lords and knights of Scotland do doubtless wait for thee there, in
obedience to thine invitation.”
It was at this time that Rory Spears, having collected a little knot of
friends about him, thus addressed them—
“Squire Spears, I am thine,” cried Roger Riddel; and the rest all
heartily joining in ready acquiescence in his invitation, they followed
Rory joyously down the hill in a body.
[Contents]
CHAPTER LIX.
Rory Spears was presiding with joyous countenance over the supper
to which he had invited his friends—the more solid part of the
entertainment had been discussed—and the ale jug had already
performed several revolutions, to the great refreshment and
restoration of the strength of those who partook of it, when the
jovial companions were suddenly disturbed in their revelry by a very
unusual cry from some of the sentinels posted along the line of
entrenchment that protected the baggage-camp. The hilarious
esquires and men-at-arms were silenced in the midst of their mirth,
and sat looking at one another with eyes of inquiry. But they sat not
long so, for the cry was repeated, and ran rapidly along the chain of
sentinels.
“By St. Lowry, it’s the English, as I’m a Christian man!” cried Rory
Spears. “My troth, it was maist ceevil of the chields to wait till we
had souped; natheless, it erketh me to think that they carried not
their courtesy so far as to permit us to drink but ae ither can. Yet, by
the Rood, we shall have at it. Here, Mrs. MacCleareye—d’ye hear,
guidwife?”
“Hark again,” cried Sang; “by all that is good, they will be in on us in
the twinkling of an eye.”
“Pay for the supper and yill, Master Spears,” cried Mrs. MacCleareye,
thrusting herself forward.
“Better now, I trow, than after thou art amortized by the sword o’
some Southron thrust through thy stomach, Master Spears,” said
Mrs. MacCleareye. “Pay to-day, I pray thee, and have trust to-
morrow.”
With a turn of his wrist, Rory shoved Mrs. MacCleareye aside. She
was jostled by Sang, who followed; and her round and rolling person
was fairly run down by MacErchar, who was pressing hastily after
them. The rest sprang impetuously over her. The cries now came
more distinctly upon them, mingled with the clash of weapons.
“Thou art right, Rory,” said Sang; “we may do much to support the
guard. Let Riddel, and I, and some others, hasten to the
entrenchments, to keep up spirit among those who may now be
fighting, with the hope of speedy aid, and do thou and the rest
quickly gather what force ye may, and straightway bring them
thither. The point of assault is narrow. If we can keep back the foe,
were it but until the main body of the army be alarmed, should our
lives be the forfeit, they would be [446]bravely spent, for we might be
the saving of Scotland’s honour this night.”
“Away, away,” cried Sang; and he and Riddel sprang off to the
trenches, followed by Lindsay and Proudfoot, whilst Rory hied him
away at the head of the others, all blowing their horns, and shouting
loudly through the lines, as if the whole Scottish array had been
there, and ready to turn out. The huts were soon deserted. Such as
they met with in their way they collected together, and armed as fast
as they could with whatever weapons lay nearest to hand; and in a
very short time these few intelligent and active heads had assembled
a force, neither very numerous nor very well appointed, it is true,
but, when headed by men so determined, amply sufficient to defend
a narrow pass between marches for a considerable time, especially
against assailants who were awed by the conviction, favoured by the
darkness, that they were attacking the camp where the whole
Scottish army were lodged.
While things were in this state in the baggage camp, the banquet in
the pavilion of Lord Douglas was going on with all that quiet and
elegant cheerfulness of demeanour beseeming a party chiefly
composed of the very flower of Scottish chivalry. The talk was of the
love of the ladies, and the glories of tilts and tournaments. Sir
Patrick Hepborne was seated between Sir John Halyburton and Sir
William de Dalzel. With the former of these knights he recalled some
of the circumstances of their friendly meeting at Tarnawa, and the
Lady Jane de Vaux was not forgotten between them. Sir William de
Dalzel changed the theme to that of the challenge which had passed
between the Lord Welles and Sir David Lindsay. Then Sir David
Lindsay himself and several others joining in the conversation, it
gradually became general around the board. Sir William de Keith, the
Marischal of Scotland, displayed his consummate learning on the
subject of such challenges between knights; and Sir John de Gordon,
Lord of Strathbolgy; Sir John Montgomery; Sir Malcolm Drummond,
brother-in-law to the Douglas, as well as to the Scottish champion,
who was the person most concerned in the debate; Sir Alexander
Fraser of Cowie, and many others, spoke each of them ably as to
particular points. The Douglas himself then delivered his judgment
with clearness and precision, and the attention with which his words
were listened to showed how valuable they were esteemed by
[447]those who heard them. After this topic was exhausted, the Earl
was indefatigable in ministering to the entertainment of his guests
by ingeniously drawing forth the powers of those around him; and
his deportment was in every respect so much more than ordinarily
felicitous, and so perfectly seasoned by graceful condescension, that
all at table agreed he never had charmed them more, and that, as
he was the hardiest warrior of all in the field, and the most resistless
lance in the lists, so was he by far the most accomplished and witty
chevalier at the festive board.
“Perdie, I did hear it also,” cried the Earl of Moray; “nor was it
strange to me. Methought I did recognize it for one of Rory Spears’
hunting-mots. He doth feast his friends to-night at the sutlerage, in
honour of his newly-acquired squireship; so, peraunter, he doth give
them music with their ale.”
“Nay, there be more performers than one there,” cried the Douglas,
rising quickly to gain the outside of the pavilion, whilst the whole of
the knights crowded after him.
“Yea,” cried the Earl of Douglas; “but dost thou see those lights that
hurry about yonder? Trust me, there is some stirring cause for the
quickness of their motions.”
“Hark ye, I hear distant and repeated cries,” said the Earl of Dunbar.
“Hark, a horse comes galloping up the hill. Hear ye how he snorts
and blows? I’ll warrant the rider hath hot news to tell.”
“The English!—the English in the baggage-camp!—Piersie and the
English!” cried the rough voice of a wainman, who made towards the
light in the pavilion, mounted on a bare-backed and unharnessed
wain-horse, that heaved its great sides as if it would have burst
them.
All was now hurry, bustle, and jostling; cries, orders, oaths, and
execrations arose everywhere. Horses were neighing, and steel was
clashing, and every one tried to buckle on his armour as fast as he
could. Meanwhile Douglas, with Moray near him, stood calm and
undismayed, putting one question after another rapidly to the varlet
who brought the alarm, until he had gained all the information he
could expect from him.
“By the Rood, but thy new esquire Rory Spears hath well demeaned
himself, brother Moray,” said Douglas. “He and those with him have
done that the which shall much avail us if we but bestir ourselves.
Let us arm then, and get the line formed. I did well mark the
ground, my friend. By skirting the woods upon our right, and if the
moon will but keep below the hill-tops long enow, we shall steal
down unseen upon the enemy, and pour out our vengeance on his
defenceless flank. May St. Andrew grant that thy gallant squire may
but keep his own until then. Haste, haste, Glendinning. Where is
Robert Hop Pringle, my brave shield-bearer? Haste thee, Hart, mine
arms and my horse. Ha, Archibald,” cried he to a young man of
noble carriage who was passing him at the moment; “get thee my
standard, my son; thou shalt bear my jamais arriere to-night. Part
with it not for thy life; and bastard though thou be’st, show thyself
at least to be no counterfeit Douglas. Quit it not even in death, boy.”
From time to time the shouts of the combatants now came faintly up
the hill-side, and hurried those hands that were busily engaged in
arming, so that many a buckle was put awry, and many a tag was
left to hang loose. The Douglas staid not to complete his harnessing,
but sprang into his saddle ere he was half armed, while Lord Moray
rode away to his post without discovering that he had forgotten to
put his helmet on.
The night still continued extremely dark, and had not Lord Douglas
taken accurate note of the ground below him whilst the light of the
sun had shone upon it, he must have found it almost impracticable
to have led his men on, notwithstanding that his ears were
admonished by the din of the distant skirmish, and the discordant
braying of at least five hundred bullocks’ horns, blown by the varlets
and wainmen who were not engaged; for such were in those days
always carried by the Scottish soldiers, and Rory Spears had taken
care that all who could not fight should at least blow, that the extent
of their force might appear the greater to the enemy.
The Douglas conducted his little army with great silence and
circumspection through the skirting brushwood; and it so
[449]happened, that just as he approached the place of action, the
full-orbed moon arose to run her peaceful and majestic course
through a clear and cloudless sky, throwing a mimic day over the
scene. Loud shouts arose from the powerful army of the English, for
now they began to comprehend the actual situation of their affairs;
and making one bold and determined charge, they burst at once
through the whole breadth of the entrenchments, overwhelming all
who attempted to stand before them. Now it was that the Scottish
Earl gave the word to his men, and just as the English were pushing
rapidly on towards the slope of the high ground where the Scottish
camp hung glittering in the moonbeam, driving a handful of brave
men before them, who were still fighting as they retired, the shout
of “Douglas!—Douglas!—Scotland!—Scotland!—Douglas!—Jamais
arriere?” ascended to Heaven, and the determined Scots poured
from their covert out upon the open plain, and rushed against the
troops of Piersie.
These upbraiding words had the effect of checking their panic, and
gave them time to observe the comparatively small body to whom
they were so basely yielding. The two brothers quickly restored the
battle by their daring example. Deafening cheers arose, shouts of
“Piersie” and “St. George” being loudly mingled with them; and a
fresh and very impetuous onset was made, that drove the Scottish
troops entirely through their entrenchments. The struggle was now
tremendous, and the clash of the Scottish axes was terrific; but,
although the success of the English wavered a little now and then,
yet the weight of their mass was so very superior, that the Scottish
army lost ground inch by inch, till, after a long contest, the Piersie
found himself almost at the Scottish tents.
“Piersie!—Piersie!—The pennon of the Piersie!” cried he, shrieking
with the wildest joy, and sanguine with the hope of [450]success;
while backed by a band of his choicest warriors, he made a bold
dash towards the standard of Scotland, that stood before the
pavilion of Douglas, with the pennon beside it. The Douglas was at
that time fighting in another part of the field, where the press
against his men was greatest. The Earls of Moray and Dunbar were
bravely striving to withstand the numbers that came against the
respective wings they commanded, supported by Montgomery, Keith,
Fraser, and many others. Assueton, though but half recovered from
the bruise he had received at Newcastle, and Halyburton, Lindsay,
and some others were doing their best to resist the tide of the
English in those parts of the battle where fortune had thrown them.
Sir William de Dalzel had been carried to his tent grievously
wounded to the loss of an eye; and already had the brave Sir
Malcolm Drummond, and the gallant Sir John de Gordon, Lord of
Strathbolgy, fallen, covered by glorious wounds. Yet was not the
standard of Scotland, nor the Piersie’s captive pennon, left
altogether undefended; for before them stood the dauntless Sir
Patrick Hepborne of Hailes the elder, with his son by his side, backed
by a small but resolute band of their own immediate dependents.
“My brave boy,” cried the elder knight, “trust me there is nowhere in
the field a more honourable spot of earth to die on than that where
we do now stand.”
“Then we quit it not with life, my father, save to drive the Piersie
before us,” cried his son.
The father and the son, with their little phalanx, remained
immovable, and, receiving them on the point of their lances, an
obstinate and bloody contest took place. Harry Piersie and his
brother fought for the fame of their proud house, and their eager
shouts were heard over all the other battle cries, as well as above
the clashing of the weapons and the shrieking of the agonized
wounded, as they were trodden under foot and crushed to death by
the press; but the bulwark of lion hearts that defended the standard
was too impregnable to be broken through. Piersie’s men already
began to slacken in their attack, and to present a looser and wider
circle to the Scottish band; and now the elder Sir Patrick Hepborne,
seeing his time, and eager to catch his advantage, brandished a
battle-axe, and his son following his example, they joined in the cry
of “A Hepborne, a Hepborne!” and charged the enemy so furiously at
the head of their men, that Piersie and his followers were driven
down the [451]slope with immense slaughter. The axes of the bold
knight and his son never fell without the sacrifice of an English life.
“A Hepborne, a Hepborne!” they cried from time to time, and “A
Hepborne, a Hepborne!” was returned to them from those who ran
together to their banner; and yet more and more of the English line
gave way before the accumulating aid that crowded after Sir Patrick
and his son, who went on gradually recovering the lost ground, by
working prodigies of valour.
“How fares it with thee, Lord Douglas?” cried Sir John Saintclaire,
overwhelmed with grief at the sad spectacle before him, and
hastening to assist the others in raising him up.
By this time the English, who had been driven for several bowshots
beyond that part of the field where the Earl of Douglas had fallen,
were now rallying under the heroic efforts of the Hotspur, who, aided
by his brother, was again cheering them on to the charge. The
Scottish troops began again to give ground before their superior
force, and were already retreating in numbers past the group who
were occupied about the dying hero. They saw the immediate
necessity of conveying him away while the ground was yet clear of
the enemy, and Lundie, Lindsay, and the two Saintclaires hastened
to obey his injunctions. He uttered not a word of complaint to tell of
the agonizing tortures he felt whilst they were removing him. They
laid him on a mossy bank among the long ferns, in the closest part
of the thicket. Then he took their hands in succession, squeezing
them with affection, and when he had thus taken leave of Lindsay
and the two Saintclaires—
“Go,” said he faintly to them, “ye have done all for the Douglas that
humanity or friendship might require of ye; go, for Scotland lacketh
the aid of your arms. Leave me with Lundie; ’tis meeter for his hand
to close the eyes of his dying lord.”
The brave knights looked their last upon him, covered their eyes and
stole silently away from a scene that entirely unmanned them.
Lundie took out a silver crucifix, and, bending over the Douglas, held
it up under a stream of moonlight that broke downwards through an
opening in the thick foliage above them.
The grief of Lindsay and the Saintclaires subdued them only whilst
they beheld the noble Douglas dying. No sooner had they left the
thicket where he lay, than, burning with impatience to revenge his
death, they hurried to the field. The younger Sir Patrick Hepborne
had already reared his fallen standard, and shouts of “Douglas!
Douglas! Jamais arriere!—A Douglas! a Douglas!” cleft the very
skies. At this moment the English were gaining ground upon the
Scottish centre, but this animating cry not only checked their retreat,
but brought aid to them from all quarters. Believing that the Douglas
was still fighting in person, down came the Earl of Moray, with
Montgomery, Keith, the Lord Saltoun, Sir Thomas Erskine, Sir John
Sandilands, and many others, and the shouts of “Douglas, Douglas!”
being repeated with tenfold enthusiasm, the charge against the
English was so resistless that they yielded before Scotland in every
direction. Bravely was the banner of Douglas borne by the gallant
Hepborne, who took care that it should be always seen among the
thickest of the foes, well aware that the respect that was paid to it
would always ensure it the close attendance of a glorious band of
knights as its defenders. As he was pressing furiously on, he
suddenly encountered an English knight, on whom his vigorous arm,
heated by indiscriminate slaughter, was about to descend. The
knight had lost his casque in the battle; the moon shed its radiance
over a head of snow-white hair, and an accidental demivolt of his
horse bringing his countenance suddenly into view, he beheld Sir
Walter de Selby.
“I thank God and the Virgin that thou art saved, old man,” cried
Hepborne, dropping his battle-axe “oh, why art thou here? Had I
been the innocent cause of thy death——”
He would have said more, and he would moreover have staid to see
him in safety. But the press came thick at the moment, and they
were torn asunder; so that Hepborne, losing all sight of him in the
melée, was compelled to look to himself.
“Yield thee,” said Sir Hugh Montgomery, “yield thee, noble Hotspur.
God wot, it were bitter grief to see so brave a heart made cold.”
“And who art thou who would have the Hotspur yield?” cried Piersie.
“I trust, Sir Harry Piersie, that to yield thee to Sir Hugh Montgomery
will do thee as little dishonour as may be,” replied the Scottish
Knight; “yield thee, then, rescue or no rescue.”
The flying English were now driven far and wide, and day began to
break ere the pursuit slackened. Among those who followed the
chase most vehemently was Sir David Lindsay. Infuriated by the loss
of the hero to whom he was so devoted, he seemed to be insatiable
in his vengeance. Whilst he was galloping after the flying foe at
sunrise, the rays, as they shot over the eastern hill, were sent back
with dazzling splendour from the gold-embossed armour of a knight
who had stopped at some distance before him to slake his thirst at a
fountain. He was in the act of springing into the saddle as Lindsay
approached; but the Scottish warrior believing, from the richness of
his armour, that he was some one of noble blood, pushed after him
so hard, and gained so much upon him, that he was nearly within
reach of him with his lance-point.
“Turn, Sir Knight,” cried Lindsay. “It is a shame thus to flee. I am Sir
David Lindsay. By St. Andrew, an thou turn not, I must strike thee
through with my lance.”
But the English knight halted not; on the contrary, he only pricked
on the more furiously, and Lindsay’s keenness being but the more
excited, he followed him at full gallop for more than a league, until
at last the English knight’s horse, which had shot considerably ahead
of his, suddenly foundered under him. The rider instantly sprang to
his legs, and drew out his sword to defend himself.
“I yield me, Sir David Lindsay,” cried the English knight, breathless
and ready to sink with fatigue; “I yield me, rescue or no rescue.”
“Ha,” replied Lindsay, “’tis well. And whom, I pray thee, mayest thou
be who has cost me so long a chase, and contest so tough, ere I
could master thee?”
“Gramercy, Sir Governor,” said Sir David Lindsay; “sit thee down,
then, with me on this bank, and let us talk a while. We seem to be
both of us somewhat toil-spent with this encounter, yea, and thy
grey destrier and my roan do seem to have had enow on’t as well as
their masters. Behold how they feed most peaceably together.”
“Let us then imitate their example, good Sir Knight of Scotland,” said
Sir Matthew Redman. “I have a small wallet here, with some neat’s
tongue, and some delicate white bread; and this leathern bottle,
though it be small, hath a cordial in it that would put life into a dead
man.”
The two foes, who had so lately endeavoured to work each other’s
death, sat down quietly together and silently partook of the
refreshment, and then alternately applying the little leathern flask to
their lips, they talked in friendly guise of the result of the battle.
By this time a thick morning mist had settled down on the face of
the country, and Lindsay had hardly well parted from the prisoner
ere he perceived that he had lost his way. As he was considering
how he should recover it, he beheld a considerable body of
horsemen approaching, and believing them to be some of the
Scottish army who had pushed on thus far in the pursuit, he rode up
to them with very great joy; but what was his surprise when he
found himself in the midst of some three or four hundred English
lances!
“Who art thou, Sir Knight?” cried the leader, who, though clad in
armour, yet wore certain Episcopal badges about him that mightily
puzzled the Scottish knight.
“I am Sir David Lindsay,” replied he; “but whom mayest thou be, I
pray thee?”
“Thine aid cometh rather of the latest, Sir Bishop,” replied Lindsay;
“for, certes, his army is routed with great slaughter, and he and his
brother Sir Rafe are prisoners in the Scottish camp.”
“I have heard as much already from some of those who fled,” replied
the Bishop: “Quæ utilitas in sanguine meo? what good would my
being killed do my cousins the Piersie? Now I do haste me back
again to Newcastle; but thou must bear me company, Sir David.”
“Sith thou dost say so, my sacred Lord,” replied Sir David, “I must of
needscost obey thee, for, backed as thou art, I dare not say thee
nay. Such is the strange fortune of war.”
Sir David now rode towards Newcastle with the Bishop, and soon
overtook the large army which he commanded that was now
returning thither. After being fairly lodged within the walls of the
town, the Bishop treated him with the utmost kindness and
hospitality, and left him to wander about at his own discretion,
rather like a guest than a prisoner. The place was filled with
mourning and lamentation, and every now and then fresh stragglers,
who had fled from the field of Otterbourne, were dropping in to tell
new tales of the grievous loss and mortifying [458]disgrace which had
befallen the English arms. Murmurs began to rise against the Bishop
because he had not proceeded against the Scots, and attempted the