100% found this document useful (2 votes)
19 views48 pages

Programming in C 1st Edition - eBook PDF download

Ebook

Uploaded by

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

Programming in C 1st Edition - eBook PDF download

Ebook

Uploaded by

rvmvylmks483
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/ 48

Programming in C 1st Edition - eBook PDF

download

https://ebookluna.com/download/programming-in-c-ebook-pdf/

Download full version ebook from https://ebookluna.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookluna.com
to discover even more!

Programming in ANSI C 6th Edition E. Balagurusamy - eBook PDF

https://ebookluna.com/download/programming-in-ansi-c-ebook-pdf/

Readings from Programming with C++ 1st Edition Kyla Mcmullen - eBook PDF

https://ebookluna.com/download/readings-from-programming-with-c-ebook-
pdf-2/

Readings from Programming with C++ 1st Edition Kyla Mcmullen - eBook PDF

https://ebookluna.com/download/readings-from-programming-with-c-ebook-pdf/

(eBook PDF) Murach's C++ Programming by Joel Murach

https://ebookluna.com/product/ebook-pdf-murachs-c-programming-by-joel-
murach/
C++ Programming 8th ed Edition D. S - eBook PDF

https://ebookluna.com/download/c-programming-ebook-pdf/

(eBook PDF) Programming, Problem Solving and Abstraction with C

https://ebookluna.com/product/ebook-pdf-programming-problem-solving-and-
abstraction-with-c/

Programming With STM32: Getting Started With the Nucleo Board and C/C++ -
eBook PDF

https://ebookluna.com/download/programming-with-stm32-getting-started-with-
the-nucleo-board-and-c-c-ebook-pdf/

C++ Programming: An Object-Oriented Approach, 1e ISE 1st Edition Behrouz A.


Forouzan - eBook PDF

https://ebookluna.com/download/c-programming-an-object-oriented-
approach-1e-ise-ebook-pdf/

(eBook PDF) Fundamentals of C# Programming for Information Systems 2nd


Edition

https://ebookluna.com/product/ebook-pdf-fundamentals-of-c-programming-for-
information-systems-2nd-edition/
Programming in C
About the Author

E Balagurusamy, is presently the Chairman of EBG Foundation, Coimbatore. In the past he has also
held the positions of member, Union Public Service Commission, New Delhi and Vice-Chancellor, Anna
University, Chennai. He is a teacher, trainer and consultant in the fields of Information Technology
and Management. He holds an ME (Hons) in Electrical Engineering and PhD in Systems Engineering
from the Indian Institute of Technology, Roorkee. His areas of interest include Object-Oriented Software
Engineering, E-Governance: Technology Management, Business Process Re-engineering and Total
Quality Management.
A prolific writer, he has authored a large number of research papers and several books. His best-selling
books, among others include:
∑ Fundamentals of Computers
∑ Computing Fundamentals and C Programming, 2e
∑ Programming in C#, 3/e
∑ Programming in Java, 5/e
∑ Object-Oriented Programming with C++, 7/e
∑ Numerical Methods
∑ Reliability Engineering
A recipient of numerous honors and awards, he has been listed in the Directory of Who's Who of
Intellectuals and in the Directory of Distinguished Leaders in Education.
Programming in C

E Balagurusamy
Chairman
EBG Foundation
Coimbatore

McGraw Hill Education (India) Private Limited


CHENNAI

McGraw Hill Education Offices


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

Published by McGraw Hill Education (India) Private Limited


444/1, Sri Ekambara Naicker Industrial Estate, Alapakkam, Porur, Chennai - 600 116

Programming in C

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

ISBN-13: 978-93-87432-36-9
ISBN-10: 93-87432-36-X
1 23456789 D101417 22 21 20 19 18
Printed and bound in India.
Managing Director: Kaushik Bellani
Director—Science & Engineering Portfolio: Vibha Mahajan
Senior Portfolio Manager—Science & Engineering: Hemant K Jha
Associate Portfolio Manager—Science & Engineering: Mohammad Salman Khurshid
Production Head: Satinder S Baveja
Assistant Manager—Production: Anuj K Shriwastava
General Manager—Production: Rajender P Ghansela
Manager—Production: Reji Kumar

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

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

visit us at: www.mheducation.co.in


Contents

Preface xiii

UNIT 1: BasIcs of c ProgrammINg


1. overview of c 3
History of C 3
Importance of C 5
Sample Program 1: Printing a Message 5
Sample Program 2: Adding Two Numbers 8
Sample Program 3: Interest Calculation 9
Sample Program 4: Use of Subroutines 11
Sample Program 5: Use of Math Functions 12
Basic Structure of C Programs 14
Programming Style 15
Executing a ‘C’ Program 15
UNIX System 16
MS-DOS System 18
Key Concepts 19
Always Remember 19
Review Questions 20
Debugging Exercises 21
Programming Exercises 22

2. constants, Variables and Data Types 24


Introduction 24
Character Set 24
C Tokens 26
Keywords and Identifiers 27
vi Contents

Constants 27
Variables 31
Data Types 32
Declaration of Variables 35
Declaration of Storage Class 38
Assigning Values to Variables 39
Defining Symbolic Constants 44
Declaring a Variable as Constant 46
Declaring a Variable as Volatile 46
Key Concepts 46
Always Remember 47
Brief Cases 47
Review Questions 50
Debugging Exercises 51
Programming Exercises 52

3. operators and Expressions 53


Introduction 53
Arithmetic Operators 54
Relational Operators 56
Logical Operators 57
Assignment Operators 58
Increment and Decrement Operators 60
Conditional Operator 61
Bitwise Operators 61
Special Operators 61
Arithmetic Expressions 63
Evaluation of Expressions 64
Precedence of Arithmetic Operators 65
Some Computational Problems 67
Type Conversions In Expressions 68
Operator Precedence and Associativity 71
Key Concepts 74
Always Remember 74
Brief Cases 75
Review Questions 77
Debugging Exercises 80
Programming Exercises 80
Contents vii

4. Managing Input and Output Operations 83


Introduction 83
Reading a Character 84
Writing a Character 87
Formatted Input 88
Formatted Output 96
Key Concepts 103
Always Remember 104
Brief Cases 104
Review Questions 108
Debugging Exercises 110
Programming Exercises 110

5. Decision making and Branching 113


Introduction 113
Decision Making with If Statement 114
Simple If Statement 114
The If.....Else Statement 117
Nesting of If....Else Statements 120
The Else If Ladder 123
The Switch Statement 127
The ? : Operator 131
The Goto Statement 135
Key Concepts 138
Always Remember 138
Brief Cases 139
Review Questions 143
Debugging Exercises 147
Programming Exercises 148

6. Decision making and Looping 151


Introduction 151
The While Statement 153
The Do Statement 155
The For Statement 158
Jumps in Loops 168
Concise Test Expressions 175
Key Concepts 175
Always Remember 175
viii Contents

Brief Cases 176


Review Questions 183
Debugging Exercises 186
Programming Exercises 187

7. The Preprocessor 191


Introduction 191
Macro Substitution 192
File Inclusion 196
Compiler Control Directives 196
ANSI Additions 200
Key Concepts 202
Always Remember 202
Review Questions 203
Debugging Exercises 204
Programming Exercises 204

UNIT 2: arrays aND sTrINgs


8. Array 207
Introduction 207
One-Dimensional Arrays 209
Declaration of One-Dimensional Arrays 210
Initialization of One-Dimensional Arrays 212
Two-Dimensional Arrays 218
Initializing Two-Dimensional Arrays 222
Multi-Dimensional Arrays 230
Dynamic Arrays 231
More About Arrays 232
Key Concepts 232
Always Remember 232
Brief Cases 233
Review Questions 246
Debugging Exercises 247
Programming Exercises 248

9. character arrays and strings 252


Introduction 252
Declaring and Initializing String Variables 253
Reading Strings from Terminal 254
Contents ix

Writing Strings to Screen 260


Arithmetic Operations on Characters 264
Putting Strings Together 266
Comparison of Two Strings 267
String-Handling Functions 267
Table of Strings 273
Other Features of Strings 275
Key Concepts 275
Always Remember 275
Brief Cases 276
Review Questions 280
Debugging Exercises 282
Programming Exercises 283

UNIT 3: fUNcTIoNs aND PoINTErs


10. User-Defined Functions 287
Introduction 287
Need for User-Defined Functions 288
A Multi-Function Program 288
Elements of User-Defined Functions 291
Definition of Functions 292
Return Values and Their Types 294
Function Calls 295
Function Declaration 297
Category of Functions 298
No Arguments and no Return Values 298
Arguments but no Return Values 300
Arguments With Return Values 304
No Arguments but Returns a Value 309
Functions that Return Multiple Values 309
Nesting of Functions 310
Recursion 311
Passing Arrays to Functions 313
Passing Strings to Functions 317
The Scope, Visibility, and Lifetime of Variables 318
Multifile Programs 328
Key Concepts 329
x Contents

Always Remember 330


Brief Cases 331
Review Questions 334
Debugging Exercises 337
Programming Exercises 338

11. Pointers 340


Introduction 340
Understanding Pointers 341
Accessing the Address of a Variable 343
Declaring Pointer Variables 344
Initialization of Pointer Variables 345
Accessing a Variable Through its Pointer 346
Chain of Pointers 348
Pointer Expressions 349
Pointer Increments and Scale Factor 351
Pointers and Arrays 351
Pointers and Character Strings 355
Array of Pointers 357
Pointers as Function Arguments 358
Functions Returning Pointers 361
Pointers to Functions 362
Pointers and Structures 364
Troubles with Pointers 367
Key Concepts 367
Always Remember 368
Brief Cases 368
Review Questions 374
Debugging Exercises 376
Programming Exercises 376

UNIT 4: sTrUcTUrEs
12. Structures and Unions 381
Introduction 381
Defining a Structure 382
Declaring Structure Variables 383
Accessing Structure Members 385
Contents xi

Structure Initialization 386


Copying and Comparingstructure Variables 388
Operations on Individual Members 390
Arrays of Structures 390
Arrays Within Structures 393
Structures Within Structures 394
Structures and Functions 396
Unions 399
Size of Structures 400
Bit Fields 400
Key Concepts 403
Always Remember 403
Brief Cases 404
Review Questions 408
Debugging Exercises 411
Programming Exercises 411

13. Dynamic Memory Allocation and Linked Lists 414


Introduction 414
Dynamic Memory Allocation 414
Allocating a Block of Memory: Malloc 415
Allocating Multiple Blocks of Memory: Calloc 417
Releasing the Used Space: Free 418
Altering the Size of a Block: Realloc 418
Concepts of Linked Lists 420
Advantages of Linked Lists 423
Types of Linked Lists 424
Pointers Revisited 424
Creating a Linked List 426
Inserting an Item 430
Deleting an Item 433
Application of Linked Lists 435
Key Concepts 435
Always Remember 436
Brief Cases 436
Review Questions 443
Debugging Exercises 444
Programming Exercises 445
xii Contents

UNIT 5: fILE ProcEssINg


14. file management in c 449
Introduction 449
Defining and Opening a File 450
Closing a File 451
Input/Output Operations on Files 452
Error Handling During I/O Operations 458
Random Access to Files 460
Command Line Arguments 467
Key Concepts 469
Always Remember 470
Review Questions 470
Debugging Exercises 471
Programming Exercises 471

Annexure 1: Model Question Papers with Hints and Short Solutions 473
annexure 2: Developing a c Program: some guidelines 492
Appendix I: Bit-Level Programming 507
appendix II: ascII Values of characters 512
Appendix III: ANSI C Library Functions 514
Preface

C
is a powerful, flexible, portable and elegantly structured programming language. Since C
combines the features of high-level language with the elements of the assembler, it is suitable
for both systems and applications programming. It is undoubtedly the most widely used general-
purpose language today in operating systems, and embedded system development. Its influence
is evident in almost all modern programming languages. Since its standardization in 1989, C has
undergone a series of changes and improvements in order to enhance the usefulness of the language.
The version that incorporates the new features is now referred to as C11.

Why this book?


This book has been designed for enhanced higher learning. It is thoroughly updated with outcome
based learning approach as per standard ‘Bloom’s Taxonomy’. Additional write-ups, projects, worked-
out- problems, review exercises, programming and debugging exercises are fused around the content
for reference of the user.

salient features of the Book


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

Digital supplements
The digital supplement can be accessed at the given link (http://www.mhhe.com/balagurusamy/picau17)
It contains the following components:
∑ Write up on Self Referential Structures
∑ Write up on Selection sort, linear and binary search
∑ Additional Programs for practice
xiv Preface

feedback
I welcome any constructive criticism of the book and will be grateful for any appraisal by the readers.
Feedback to improve the book will be highly appreciated.
E Balagurusamy

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

Chapter 1 Overview of C
Chapter 2 Constants, Variables and Data Types
Chapter 3 Operators and Expressions
Chapter 4 Managing Input and Output Operations
Chapter 5 Decision Making and Branching
Chapter 6 Decision Making and Looping
Chapter 7 The Preprocessor
Another Random Scribd Document
with Unrelated Content
[16] One should almost suppose that the historian had recollected
Cyrano de Bergerac's dream of a visit to the infernal regions,
where he saw the Duke of Clarence, "who," says he, "voluntarily
drowned himself in a barrel of Malmsey, seeking for Diogenes, in
hopes of getting half his tub to lodge in."
KING HENRY VI.
PART III.
ACT I.
Scene 1. Page 223.
Exe. Here comes the queen whose looks bewray her
anger.
Although the word bewray has received very proper illustration on
the present and other occasions, it remains to observe that its
simple and original meaning was to discover or disclose; that it has
been confounded with betray, which is used, though not exclusively,
for to discover for bad or treacherous purposes, a sense in which
bewray is never properly found. Of this position take the following
proof: "If you do so, saide the other, then you ought to let me
knowe what so ever you know your selfe: unlesse you thinke that
yourself will bewray yourself, except you doubt yourself will deceive
yourself, and unlesse you thinke that yourself will betray your self."—
Lupton's Siuqila, 1580, 4to, sign. L 4. b.
Scene 1. Page 224.
Q. Mar. Rather than made that savage duke thine heir.
The note which follows Mr. Steevens's was not inadvertently
introduced by that gentleman, though it certainly should not have
been retained as the text now stands.
Scene 4. Page 242.
Q. Mar. [Putting a paper crown on his head.]
Mr. Ritson has not shown, as he conceived he had, that the
preceding commentator was certainly mistaken: for the author of the
play, if he be accountable for the stage direction, could not have
"followed history with the utmost precision," when he makes queen
Margaret put a paper crown on York's head; whereas Holinshed, the
black-letter chronicler whom Mr. Ritson should have first consulted,
and who only follows Whethamstede, relates that a garland of
bulrushes was placed on York's head; which was afterwards stricken
off and presented to the queen. Nor is there historical evidence that
the queen herself put on the crown. Shakspeare has continued the
same error in King Richard the Third, where he makes Gloucester
say to queen Margaret,

"The curse my noble father laid on thee


When thou didst crown his noble brows with paper."

He was therefore, in this instance, misled by the author of King


Henry the Sixth; or he must have written the queen's speech
himself.
Scene 4. Page 244.
York. Whose tongue more poisons than the adder's
tooth.
Again in Cymbeline, Act III. Scene 4;
"Whose tongue outvenoms all the worms of Nile."

ACT III.
Scene 2. Page 310.

L. Grey. But, mighty lord, this merry inclination


Accords not with the sadness of my suit.

The following is offered as a very select instance of the use of


sadness for seriousness. It is from Tom Coriat's speech that he made
to a Mahometan who had called him an infidel. "But I pray thee tell
me thou Mahometan, dost thou in sadness call me Giaur? That I
doe, quoth he. Then quoth I, in very sober sadness I retort that
shameful word in thy throate."
Scene 2. Page 314.
Glo. Like to a chaos, or an unlick'd bear-whelp.
The common opinion which Dr. Johnson mentions of the bear
bringing forth unformed lumps of animated flesh, and afterwards
licking them into proper shape, has been very properly exposed and
confuted by Sir Thomas Brown in his Enquiries into vulgar errors,
book iii. ch. 6. His adversary Ross, in his Arcana microcosmi, p. 115,
has attempted a solution of this matter, by stating it as a fact that
bears bring forth their young deformed and mis-shapen, by reason
of the thick membrane in which they are wrapped, that is, covered
over with a mucous and phlegmatick matter. This, he says, the dam
contracts in the winter time, by lying in hollow caves without motion,
so that to the eye the cub appears like an unformed lump. The
above mucilage is afterwards licked away by the dam, and the
membrane broken, whereby that which before seemed to be
unformed appears now in its right shape. And this, he contends,
against Dr. Brown, is all that the ancients meant. See more on the
subject of the old opinion in Bartholomæus De proprietat. rerum, lib.
xviii. c. 112.

ACT IV.
Scene 7. Page 359.
Glo. For many men that stumble at the threshold.
To understand this phrase rightly, it must be remembered that some
of the old thresholds or steps under the door, were, like the hearths,
raised a little, so that a person might stumble over them unless
proper care was taken. A very whimsical reason for this practice is
given in a curious little tract by Sir Balthazar Gerbier, entitled,
Councel and advice to all builders, 1663, 24mo, in these words, "A
good surveyour shuns also the ordering of doores with stumbling-
block-thresholds, though our forefathers affected them, perchance to
perpetuate the antient custome of bridegroomes, when formerly at
their return from church [they] did use to lift up their bride, and to
knock their head against that of the doore, for a remembrance, that
they were not to passe the threshold of their house without their
leave."

ACT V.
Scene 7. Page 403.

Clar. What will your grace have done with Margaret?


Reignier her father, to the king of France
Hath pawn'd the Sicils and Jerusalem,
And hither have they sent it for her ransom.

Unless there be some omission in this speech, it must either be


regarded as improperly elliptical, or as ungrammatical. It refers to
the sum of money borrowed by Margaret's father, which is
mentioned by the French historians to have been fifty thousand
crowns. The author of the play followed Holinshed.

The right accentuation of Hĕcătē, as well as the proper description


of Althea's torch, which Shakspeare, in King Henry the Fourth, had
misrepresented, are additional arguments that he did not write the
whole of these plays; but that they were composed by some person
who had more classical knowledge, but infinitely less genius than
our author.
KING RICHARD III.
ACT I.
Scene 1. Page 461.

Glo. He capers nimbly in a lady's chamber


To the lascivious pleasing of a lute.

The question with Dr. Johnson is, whether it be war that capers, or
York; and he justly remarks that if the latter, the antecedent is at an
almost forgotten distance. The amorous temper of Edward the
Fourth is well known; and there cannot be a doubt that by the
lascivious pleasing of a lute, he is directly alluded to. The
subsequent description likewise that Richard gives of himself is in
comparison with the king. Dr. Johnson thought the image of war
capering poetical; yet it is not easy to conceive how grimvisag'd war
could caper in a lady's chamber.
Scene 1. Page 462.
Glo. Cheated of feature by dissembling nature.
The poet by this expression seems to mean no more than that
nature had made for Richard features unlike those of other men. To
dissemble, both here and in the passage quoted from King John,
signifies the reverse of to resemble, in its active sense, and is not
used as dissimulare in Latin.

ACT II.
Scene 3. Page 540.
2 Cit. Ill news by'r lady; seldom comes the better.
Well might the author of the book quoted by Mr. Reed say "that
proverb indeed is auncient," as will appear from the following
curious account of its origin extracted from a manuscript collection
of stories compiled about the time of king Henry the Third:—
"Quidam abbas dedit monachis suis tria fercula. Dixerunt monachi,
Iste parum dat nobis. Rogemus Deum ut cito moriatur. Et sive ex hac
causa, sive ex alia, mortuus est. Substitutus est alius, qui eis tamen
dedit duo fercula. Irati monachi contristati dixerunt, Nunc magis est
orandum, quia unum ferculum subtractum est, Deus subtrahat ei
vitam suam. Tandem mortuus est. Substitutus est tertius, qui duo
fercula subtraxit. Irati monachi dixerunt, Iste pessimus est inter
omnes, quia fame nos interficit; rogemus Deum quod cito moriatur.
Dixit unus monachus, Rogo Deum quod det ei vitam longam, et
manu teneat eum nobis. Alii admirati querebant quare hoc diceret;
qui ait, Vide quod primus fuit malus, secundus pejor, iste pessimus;
timeo quod cum mortuus fuerit alius pejor succedet, qui penitus nos
fame perimet. Unde solet dici, Seilde comed se betere."
Scene 4. Page 546.
Q. Eliz. A parlous boy.
"Parlous," says Mr. Steevens, "is keen, shrewd." Mr. Ritson is of a
different opinion, and thinks it a corruption of perilous, dangerous.
Both parties are right; but it is probably used here as perilous, in like
manner as the nurse in Romeo and Juliet talks of "a parlous knock,"
and as it is also to be taken in A midsummer night's dream, where
Mr. Steevens had properly explained it; and the instance which he
has given on the present occasion does, in fact, corroborate his
former note. Parlous is likewise made synonymous with shrewd by
Littelton. See his Latin dict. v. importunus. In Middleton's play of The
changeling, we have "a parlous fool," i. e. shrewd, "he must sit in
the fourth form at least." Yet a few pages further the same word is
as clearly used for perilous. After all there is little or no difference in
the senses of it, for in shrewdness there is certainly peril. He that
meets with a shrew, may well be said to be in danger. Some might
think that this word is the same as talkative, in which case it must
have been borrowed from the French; but that language does not
furnish an adjective of the kind. The original corruption was perlious.
Thus in an unpublished work by William of Nassyngton, a poet of the
fifteenth century, who wrote on the Lord's prayer, &c., we have,
"Methinks this maner is perlious."

ACT III.
Scene 1. Page 561.

York. Uncle, my brother mocks both you and me;


Because that I am little, like an ape,
He thinks that you should bear me on your shoulders.

Mr. M. Mason contends that this is simply an allusion to Richard's


deformity, and is not inclined to admit the propriety of Dr. Johnson's
supposition that York means to call his uncle a bear. From a
quotation given by the former gentleman, it is clear that Shakspeare,
when alluding to Richard's deformity, mentions his back; and it is
therefore probable that he would have used the same term in the
present instance, had he adverted to the duke's shape. For this
reason Dr. Johnson's opinion seems preferable; yet something more
might have been intended. The practice of keeping apes or domestic
monkeys was formerly much more common than at present. Many
old prints and paintings corroborate this observation,[17] and in
some the monkey appears chained to a large globe or roller of
wood, which, whilst it permitted the animal to shift his situation,
prevented him from making his escape. It is almost unnecessary to
add that the monkey, as the intimate companion of the domestic
fool, would often get upon his shoulders. There is a fine picture, by
Holbein, of Henry the Eighth and some of his family, which by favour
of his majesty now decorates the meeting room of the Society of
Antiquaries. In it is an admirable portrait of Will Somers, the king's
fool, with a monkey clinging to his neck, and apparently occupied in
rendering his friend William a very essential piece of service, wherein
this animal is remarkably dexterous, the fool reclining his head in a
manner that indicates his sense of the obligation. York may therefore
mean to call his uncle a fool, and this, after all, may be the scorn
that Buckingham afterwards refers to.
Every one is acquainted with the propensity of the monkey to
climbing upon other animals. Gervase Markham in his Cavalerice, a
treatise on horsemanship, already referred to, devotes a chapter to
inform his readers "how a horse may be taught to doe any tricke
done by Bankes his curtall," in which he says, "I will shew you by
the example of two or three trickes, how you shall make your horse
to doe any other action as well as any dog or ape whatsoever,
except it be leaping upon your shoulders." The curious reader may
find more illustration of the subject in the specimen of Dr. Boucher's
Supplement to Johnson's dictionary, article ape; but the learned and
ingenious author was certainly mistaken in supposing that fools
carried the representations of apes on their shoulders, and probably
in what he says concerning the origin of the phrase of putting an
ape in a man's hood.

ACT IV.
Scene 2. Page 621.
K. Rich. Because that like a Jack, thou keep'st the
stroke.
At Horsham church, in Sussex, there was a figure dressed in scarlet
and gold, that struck the quarters. He was called Jack o' the clock-
house. The French term for this kind of automaton is jaquemar, the
etymology of which is very fanciful and uncertain.

ACT V.
Scene 1. Page 660.
Buck. Holy king Henry——
This epithet is not applied without good reason. King Henry the
Sixth, though never actually canonized, was regarded as a saint, and
miracles were supposed to have been performed by him. In some of
our church service-books before the Reformation, there are prayers
which are said to have been of his composition, and one in particular
that is addressed to him is entitled, "A prayer to holy king Henry."
Scene 3. Page 665.
K. Rich. Besides, the king's name is a tower of
strength.
Borrowed from Proverbs, xviii. v. 10. "The name of the Lord is a
strong tower."
Scene 3. Page 667.

Cate. ... It's supper time, my lord;


It's nine o'clock.

"A supper at so late an hour as nine o'clock in the year 1485," says
Mr. Steevens, "would have been a prodigy." It certainly would, and
even at the time when this play was written, the period to which the
criticism more justly belongs. In either instance there was a reason
for preferring the text of the quarto copy, and yet the unnecessary
alteration is retained.
Scene 3. Page 688.
K. Rich. This and Saint George to boot.
Dr. Johnson is undoubtedly right against both his opponents, one of
whom has adduced the phrase St. George to borrow, unintentionally
in support of him. To borrow is no more a verb than to boot; it
means as a pledge or security, borrow being the Saxon term for a
pledge. The phrase is an invocation to the saint to act as a protector.
Saint George to thrive is evidently a misconceived paraphrase of the
old mode of expression, by improperly changing the substantive to a
verb. Holinshed, in the speech of Richard before the battle,
introduces "St. George to borrowe."
Scene 3. Page 690.
K. Rich. Long kept in Bretagne at our mother's cost.
It has already been stated by Dr. Farmer that the mistake here of
mother for brother must be placed to the account of the book which
Shakspeare followed, viz. Holinshed's chronicle; but the doctor has
omitted to notice that in the first edition of Holinshed the word is
rightly printed brother. It is no otherwise worth while to mention this
fact, than that it points out the particular edition of the above
historian which Shakspeare used. Nothing can be more judicious nor
decisive than Mr. Malone's argument for retaining the historical
errors of Shakspeare, and Mr. Ritson's desire of changing the text
does not correspond with those principles of accuracy on which he
laid so much stress.
Scene 3. Page 691.
K. Rich. A milksop, &c.
This is from Holinshed, "To begyn with the earle of Richmonde
capitayne of this rebellion, he is a Welsh milksoppe," &c.

FOOTNOTES:
[17] See the fine frontispiece by Coriolano to Vesalius's Anatomy.
KING HENRY VIII.
ACT I.
Scene 1. Page 21.

Buck. ... but this top-proud fellow


(Whom from the flow of gall I name not, but
From sincere motions)

Dr. Johnson explains sincere motions to be honest indignation; and,


for name not, would substitute blame not. But is not the following
the plain sense, without any alteration? "this top-proud fellow, whom
I call so, not from an excess of bitterness, but from a genuine
impulse of the mind."
Scene 1. Page 26.

Buck. I am the shadow of poor Buckingham,


Whose figure even this instant cloud puts on,
By dark'ning my clear sun.

It is no easy matter on some occasions to comprehend the precise


meaning of Shakspeare's metaphors, which are often careless and
confused; and of this position the present lines are, doubtless, an
example. We have here a double comparison. Buckingham is first
made to say that he is but a shadow; in other terms, a dead man.
He then adverts to the sudden cloud of misfortune that overwhelms
him, and, like a shadow, obscures his prosperity.
Scene 3. Page 42.
Cham. Is it possible the spells of France should juggle
Men into such strange mysteries?

Dr. Johnson's explanation is much too fanciful. Mysteries are arts,


and here artificial fashions.

ACT II.
Scene 2. Page 71.
Nor. I'll venture one heave at him.
The first folio reads "I'll venture one; have at him," and this, except
as to the punctuation, is right. Have at you was a common phrase; it
is used by Surrey in the ensuing act, and afterwards by Cromwell.
Scene 2. Page 73.

Cam. ... which so griev'd him, [Doctor Pace]


That he ran mad and died.

This is from Holinshed. "Aboute this time the king received into favor
doctor Stephen Gardiner, whose service he used in matters of great
secrecie and weighte, admitting him in the room of Doctor Pace, the
which being continually abrode in ambassades, and the same
oftentymes not much necessarie, by the Cardinalles appointment, at
length he toke such greefe therwith, that he fell out of his right
wittes."
Scene 3. Page 75.

Anne. ... 'tis a sufferance panging


As soul and body's severing.
Of the parallel passages already cited, this is not the least so, from
Measure for measure;

"... in corporal sufferance feels a pang as great


As when a giant dies."

Scene 4. Page 98.


[they rise to depart.
Mr. Ridley's note is very judiciously introduced to get rid of the
interpolated stage direction inserted by some of the editors, and to
account for the king's apostrophe to Cranmer. He might have
adduced an earlier exemplification of his remark from the ensuing
scene, where Norfolk asks, when Cranmer returns? The archbishop
of Canterbury, who attends the procession to Blackfriars, was
William Warham.

ACT III.
Scene 2. Page 112.

Suf. ... I persuade me, from her


Will fall some blessing to this land, which shall
In it be memoriz'd.

This is, no doubt, a compliment to queen Elizabeth.


Scene 2. Page 126.

Sur. ... I'll startle you


Worse than the sacring bell, when the brown wench
Lay kissing in your arms, lord cardinal.
Was there any Skeltonical tradition to this effect in Shakspeare's
time, or has he only taken a hint from one of the articles against
Wolsey, which is conceived in the following terms? "Also the said
Lord Cardinall did call before him Sir John Stanly knight which had
taken a farm by Covent seal of the Abbot of Chester and afterwards
by his power and might contrary to right committed the said Sir John
Stanly to the prison of Fleet by the space of a year unto such time
as he compelled the said Sir John to release his Covent seal to one
Leghe of Adlington, which married one Lark's daughter, which
woman the said Lord Cardinall kept, and had with her two children,"
&c.
Scene 2. Page 127.

Sur. First, that, without the king's assent, or


knowledge,
You wrought to be a legate; by which power
You maim'd the jurisdiction of all bishops.

We have here in substance the first of the articles exhibited by the


lords of the privy council and two of the judges against Wolsey. They
had been unfaithfully recorded in some of our histories, but were at
length printed by Lord Coke from the originals in his fourth Institute,
chap. 8.
Scene 2. Page 127.

Nor. Then, that, in all you writ to Rome, or else


To foreign princes, Ego et rex meus
Was still inscrib'd; in which you brought the king
To be your servant.

The nature of this supposed offence has been apparently


misconceived by Shakspeare and others whom he might have
followed. The original article against Wolsey, states, that "the Lord
Cardinall of his presumptuous mind, in divers and many of his letters
and instructions sent out of this realme to outward parts had joyned
himself with your Grace, as in saying and writing, The king and I
would ye should do thus. The king and I doe give unto you our
hearty thankes. Whereby it is apparent that he used himself more
like a fellow to your Highnes, then like a subject." Wolsey's crime
therefore was not in degrading the king beneath himself, but in
assuming a degree of consequence that seemed to place him on a
level with his sovereign. The offensive language when put into Latin
would be more striking and apt to deceive; but the idiom of the
language required the above arrangement of the words.
Scene 2. Page 128.

Suf. Then that without the knowledge


Either of king or council, when you went
Ambassador to the emperor, you made bold
To carry into Flanders the great seal.

Sur. Item, you sent a large commission


To Gregory de Cassalis, to conclude,
Without the king's will, or the state's allowance,
A league between his highness and Ferrara.

Both these charges seem included in the third article. "Also the said
Lord Cardinall being your ambassador in France, sent a commission
to Sir Gregory de Cassalis under your great seale in your grace's
name to conclude a treaty of amity with the Duke of Ferrara, without
any commandment or warrant of your highnes, nor your said
highnesse advertised or made privy to the same."
Scene 2. Page 129.

Suf. That out of mere ambition you have caus'd


Your holy hat to be stamp'd on the king's coin.
An absurd and frivolous allegation against the unfortunate Cardinal,
being the substance of the fortieth article. The episcopal privileges
of coining money had been long established, and were conceded in
this reign to Bainbrigge and Lee the predecessor and successor of
Wolsey, as well as to the archbishops of Canterbury, Warham and
Cranmer. But the great offence was placing the Cardinal's hat under
the king's arms, "which like deed," says the article, "hath not been
seen to be done by any subject within your realm before this time."
It may be asked how could it, Wolsey being the only English cardinal
to whom the privilege of striking money had been granted? Nor
could there be any substantial reason for regarding the cardinal's hat
as more offensive than the bishop's mitre, which had already
appeared on the coins of Durham.
Scene 2. Page 129.

Suf. Lord Cardinal, the king's further pleasure is,—


Because all those things, you have done of late
By your power legatine within this kingdom,
Fall into the compass of a præmunire,—
That therefore such a writ be sued against you.

The poet was under the necessity of introducing the præmunire


immediately after the articles; but we learn from Cavendish that
"Maister Cromwell inveighed against the byll of articles with such
wittie persuasions and depe reasons that the same could take none
effect. Then were his enemyes constrained to indite him in a
PREMUNIRE," &c.
Scene 2. Page 131.
Wol. And when he falls, he falls like Lucifer.
Manifestly borrowed from that fine passage in Isaiah, xiv. ver. 12:
"How art thou fallen from heaven, O Lucifer, son of the morning!"
Scene 2. Page 135.
Wol. And sleep in dull cold marble.
Mr. Gray seems to have remembered this line in his elegy,—
"Or flattery sooth the dull cold ear of death."
Scene 2. Page 137.

Wol. Had I but serv'd my God with half the zeal


I serv'd my king, he would not in mine age
Have left me naked to mine enemies.

Dr. Johnson remarks, that "this sentence was really uttered by


Wolsey." The substance of it certainly was. The words themselves
have been preserved in the valuable Life of Wolsey by George
Cavendish his gentleman usher, which Shakspeare might have used
either in Stowe's chronicle or in manuscript; for several copies are
still remaining that were transcribed in the reign of Elizabeth. Mr.
Malone has already taken due notice of their very superior value,
and of the omissions and interpolations in the printed editions. In
the latter, the work has been abridged of many details of great
curiosity with respect to the manners of the times. A new and
correct edition would be well deserving of the patronage of an
enlightened public. The real words uttered by Wolsey were these;
"Yf I hadd served God as diligently as I have done the kinge, he
wolde not have geven me over in my graye heares."

ACT V.
Scene 3. Page 193.
Man. ... and hit that woman, who cry'd out, Clubs!
It has been observed, in illustration of this practice of crying out
clubs, that it was usually adopted in any quarrel or tumult in the
streets; but it remains to point out the persons that were so called,
because the watchmen's weapon was the bill. Stowe informs us, that
"when prentizes and journeymen attended upon their masters and
mistresses in the night, they went before them carrying a lanthorne
and candle in their hands, and a great long club on their neckes."—
Annales, p. 1040, edit. 1631. The frequency of this exclamation in
nocturnal quarrels might in process of time adapt the expression to
general occasion.
Scene 4. Page 199.
It is submitted that the stage exhibition of Elizabeth's christening
should be conducted according to the curious and circumstantial
details of the manner in which it was really performed, to be found
in Halle's Chronicle, and copied from him by Stowe into his Annales.
TROILUS AND CRESSIDA.
PROLOGUE.
... Priam's six-gated city.
In this, as well as in Dr. Farmer's subsequent note, it might have
been better to have quoted Caxton's translation of the Recuyles or
destruction of Troy, instead of Lydgate. In the edition of 1607 of the
former work, which, in all probability, is that used by the author of
the play, the gates of Troy are thus named; Dardan, Timbria, Helias,
Chetas, Troyen, Antenorides. These are nearer to the text than those
in the other quotation from Lydgate, whose work the author does
not seem to have consulted. Should the curious reader be desirous
of seeing the manner in which Troy was formerly represented, he
may be gratified by an inspection of it in its full glory; the gates
inscribed with their names, and fortified with portcullises, in the
edition of Jaques Milot's Mystere de la destruction de Troye, Lyon,
1544, folio; or in Raoul le Fevre's Recueil des hystoires Troyennes,
Lyon, 1510, folio. This was also a favourite subject in old tapestry, a
very fine and ancient specimen of which remained a long time in the
painted chamber that separates the two houses of parliament, till it
was removed during the repairs of Saint Stephen's chapel for the
accommodation of the Irish members. A copy of it was fortunately
taken by that ingenious artist, Mr. John Carter, draughtsman to the
Society of Antiquaries.

ACT I.
Scene 1. Page 223.
Tro. Thou lay'st in every gash that love hath given me
The knife that made it.

When poets speak of the wounds inflicted by love, they generally


make the instrument to be an arrow; how a knife came here to be
introduced is not easy to account for. Is it possible that our author
has transposed the old saying that a knife cuts love?
Scene 3. Page 245.

Nest. ... and, anon, behold


The strong-ribb'd bark through liquid mountains cut,
Bounding between the two moist elements,
Like Perseus' horse.

Mr. Steevens, admitting the curiosity of his colleague's note on this


passage, is unwilling to allow that its design to prove the horse of
Perseus a ship, and not an animal, has been accomplished. The
learned editor observes, that "Shakspeare would not have contented
himself with merely comparing one ship to another;" and that
"unallegorized Pegasus might be fairly stiled Perseus' horse, because
the heroism of Perseus had given him existence." That one thing is
compared to another which resembles it, can surely be no solid
objection to the justice of a comparison; and though the birth of the
unallegorized Pegasus was doubtless the result of Perseus's bravery
in conquering Medusa, it was incumbent on the objector to have
demonstrated how this horse of Perseus had "bounded between two
moist elements," to have made good the poet's comparison. There
can be no doubt that the author of the simile has alluded to the fact
concerning the ship Pegasus adduced by Mr. Malone; and every
thing leads to the supposition that he used the authority of Caxton's
Troy book, though, as will be seen presently, that was not the most
ancient of the kind.
It is undoubtedly a well justified poetical license to compare a ship
to a horse, on account of its speed. In the translation of an old Celtic
ballad called The maid's tragedy, the monarch who pursues the
flying damsel is sometimes said to traverse the waves on an
enchanted steed; "which," say the Edinburgh reviewers, "probably
arises from some equivocal expression in the original, as the Scalds
term a ship the rider, and sometimes the horse of the ocean."—
Edinb. review, 1805, p. 439.
Mr. Malone has stated in the beginning of his valuable note, that "we
nowhere hear of Perseus's horse;" and that "Pegasus was the
property not of Perseus but of Bellerophon." This is not quite
accurate. It is certain that Ovid has not mounted Perseus on any
horse in his combat with the monster which was to devour
Andromeda; and therefore it is matter of wonder that the
mythological dictionary of Chompré, and particularly that most
excellent one by Lempriere, should positively affirm that he has. This
error has been likewise adopted by other writers. But though classic
authority be wanting that Perseus made use of a horse, Boccaccio, in
his Genealogia Deorum, lib. xii. c. 25, has quoted Lactantius as
saying, that when Perseus undertook his expedition against Gorgon,
at the instance of king Polydectus, he was accompanied by the
winged horse Pegasus, but not that he used him in delivering
Andromeda. Boccaccio adds that others were of opinion that he had
a ship called Pegasus. The liberties which the old French translators
of Ovid's Metamorphoses have taken, and their interpolations, are
unaccountable. Some have caused Perseus at the instant of his birth,
to bestride Pegasus, and travel away to Helicon. In the cuts to many
of the early editions of Ovid, the designers have not only placed him
on Pegasus in the adventure with Andromeda, but even in his attack
upon Atlas. These facts may serve to account for the multiplied
errors of artists, who, neglecting to consult proper authorities, have
trusted to the erroneous examples of their predecessors. Achilles
Tatius, in his third book of The loves of Clitophon and Leucippe, has
described a picture of Perseus delivering Andromeda, in which he is
made to descend by means of wings to his feet; and another on the
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!

ebookluna.com

You might also like