Beej S Guide To C Programming Brian Beej Jorgensen Hall PDF Download
Beej S Guide To C Programming Brian Beej Jorgensen Hall PDF Download
https://ebookmeta.com/product/beej-s-guide-to-c-programming-
brian-beej-jorgensen-hall/
https://ebookmeta.com/product/beej-s-guide-to-c-programming-
brian-beej-jorgensen-hall-5/
https://ebookmeta.com/product/beej-s-guide-to-c-programming-
brian-beej-jorgensen-hall-6/
https://ebookmeta.com/product/beej-s-guide-to-c-programming-
brian-beej-jorgensen-hall/
https://ebookmeta.com/product/deathly-delinquency-1st-edition-
eva-chase/
The Last Hard Boy The Hard Boys 3 1st Edition Sam
Crescent
https://ebookmeta.com/product/the-last-hard-boy-the-hard-
boys-3-1st-edition-sam-crescent/
https://ebookmeta.com/product/making-and-breaking-the-grid-a-
graphic-design-layout-workshop-second-edition-timothy-samara/
https://ebookmeta.com/product/sustainable-design-hci-usability-
and-environmental-concerns-2nd-edition-tomayess-issa/
https://ebookmeta.com/product/security-observability-with-
ebpf-1st-edition-jed-salazar/
One Last Smile 1st Edition Gs Rhodes
https://ebookmeta.com/product/one-last-smile-1st-edition-gs-
rhodes/
Beej’s Guide to C Programming
1 Foreword 1
1.1 Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 How to Read This Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Platform and Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Official Homepage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.5 Email Policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.6 Mirroring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.7 Note for Translators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.8 Copyright and Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.9 Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Hello, World! 5
2.1 What to Expect from C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Hello, World! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 Compilation Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Building with gcc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Building with clang . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.6 Building from IDEs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.7 C Versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Functions 25
4.1 Passing by Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2 Function Prototypes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.3 Empty Parameter Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
i
CONTENTS ii
5 Pointers—Cower In Fear! 29
5.1 Memory and Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.2 Pointer Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.3 Dereferencing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
5.4 Passing Pointers as Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.5 The NULL Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.6 A Note on Declaring Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.7 sizeof and Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6 Arrays 36
6.1 Easy Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
6.2 Getting the Length of an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.3 Array Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.4 Out of Bounds! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.5 Multidimensional Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.6 Arrays and Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.6.1 Getting a Pointer to an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.6.2 Passing Single Dimensional Arrays to Functions . . . . . . . . . . . . . . . . . . . 41
6.6.3 Changing Arrays in Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
6.6.4 Passing Multidimensional Arrays to Functions . . . . . . . . . . . . . . . . . . . 43
7 Strings 45
7.1 String Literals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.2 String Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
7.3 String Variables as Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.4 String Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.5 Getting String Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.6 String Termination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.7 Copying a String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
8 Structs 50
8.1 Declaring a Struct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
8.2 Struct Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.3 Passing Structs to Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
8.4 The Arrow Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.5 Copying and Returning structs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.6 Comparing structs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
9 File Input/Output 54
9.1 The FILE* Data Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
9.2 Reading Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.3 End of File: EOF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.3.1 Reading a Line at a Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.4 Formatted Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
9.5 Writing Text Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
9.6 Binary File I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
9.6.1 struct and Number Caveats . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
13 Scope 84
13.1 Block Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
13.1.1 Where To Define Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
13.1.2 Variable Hiding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
13.2 File Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
13.3 for-loop Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
13.4 A Note on Function Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
31 goto 224
31.1 A Simple Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
31.2 Labeled continue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
31.3 Bailing Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
31.4 Labeled break . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
31.5 Multi-level Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
31.6 Tail Call Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
31.7 Restarting Interrupted System Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
31.8 goto and Thread Preemption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
31.9 goto and Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
31.10 goto and Variable-Length Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
39 Multithreading 267
39.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
39.2 Things You Can Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
39.3 Data Races and the Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
39.4 Creating and Waiting for Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
39.5 Detaching Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
39.6 Thread Local Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
39.6.1 _Thread_local Storage-Class . . . . . . . . . . . . . . . . . . . . . . . . . . 275
39.6.2 Another Option: Thread-Specific Storage . . . . . . . . . . . . . . . . . . . . . 275
39.7 Mutexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
39.7.1 Different Mutex Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
39.8 Condition Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
39.8.1 Timed Condition Wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
39.8.2 Broadcast: Wake Up All Waiting Threads . . . . . . . . . . . . . . . . . . . . . 285
39.9 Running a Function One Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
40 Atomics 286
40.1 Testing for Atomic Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
40.2 Atomic Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
40.3 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
40.4 Acquire and Release . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
40.5 Sequential Consistency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
CONTENTS ix
Foreword
1.1 Audience
This guide assumes that you’ve already got some programming knowledge under your belt from another
language, such as Python2 , JavaScript3 , Java4 , Rust5 , Go6 , Swift7 , etc. (Objective-C8 devs will have a par-
1
https://www.ioccc.org/
2
https://en.wikipedia.org/wiki/Python_(programming_language)
3
https://en.wikipedia.org/wiki/JavaScript
4
https://en.wikipedia.org/wiki/Java_(programming_language)
5
https://en.wikipedia.org/wiki/Rust_(programming_language)
6
https://en.wikipedia.org/wiki/Go_(programming_language)
7
https://en.wikipedia.org/wiki/Swift_(programming_language)
8
https://en.wikipedia.org/wiki/Objective-C
1
Chapter 1. Foreword 2
As a rule, the more complex the question, the less likely I am to respond. If you can narrow down your
question before mailing it and be sure to include any pertinent information (like platform, compiler, error
messages you’re getting, and anything else you think might help me troubleshoot), you’re much more likely
to get a response.
If you don’t get a response, hack on it some more, try to find the answer, and if it’s still elusive, then write
me again with the information you’ve found and hopefully it will be enough for me to help out.
Now that I’ve badgered you about how to write and not write me, I’d just like to let you know that I fully
appreciate all the praise the guide has received over the years. It’s a real morale boost, and it gladdens me to
hear that it is being used for good! :-) Thank you!
1.6 Mirroring
You are more than welcome to mirror this site, whether publicly or privately. If you publicly mirror the site
and want me to link to it from the main page, drop me a line at [email protected].
1.9 Dedication
The hardest things about writing these guides are:
• Learning the material in enough detail to be able to explain it
• Figuring out the best way to explain it clearly, a seemingly-endless iterative process
• Putting myself out there as a so-called authority, when really I’m just a regular human trying to make
sense of it all, just like everyone else
• Keeping at it when so many other things draw my attention
Chapter 1. Foreword 4
A lot of people have helped me through this process, and I want to acknowledge those who have made this
book possible.
• Everyone on the Internet who decided to help share their knowledge in one form or another. The free
sharing of instructive information is what makes the Internet the great place that it is.
• The volunteers at cppreference.com16 who provide the bridge that leads from the spec to the real world.
• The helpful and knowledgeable folks on comp.lang.c17 and r/C_Programming18 who got me through
the tougher parts of the language.
• Everyone who submitted corrections and pull-requests on everything from misleading instructions to
typos.
Thank you! ♥
16
https://en.cppreference.com/
17
https://groups.google.com/g/comp.lang.c
18
https://www.reddit.com/r/C_Programming/
Chapter 2
Hello, World!
5
Exploring the Variety of Random
Documents with Different Content
sensitive; but now and again he felt tempted to rush off with Priscilla
to some place where they could escape for ever from this horror of
publicity which was besetting them. He did not mind being made the
subject of leading articles, if it was his incapacity as an orator or his
ignorance of the political standpoint that was being assailed; but this
intrusion upon his private life was as distasteful to him as it would be
for anyone to see one’s dressing-room operations made the subject
of a cinematograph display.
How could he feel otherwise, when almost daily he could espy
strangers—men with knapsacks and women with veils (mostly
green), all of them carrying walking sticks—coming halfway up the
avenue and exchanging opinions as to the best point from which the
house could be snapshotted? Such strangers were no more
infrequent than the visits of men on motors—all sorts of motors,
from the obsolete tri-car to the 60 h.p. F.I.A.T. He was obliged to
give orders at the lodge gates that on no pretence was a motor to
be allowed to pass on to the avenue, and that bicycling strangers, as
well as pedestrians with kodaks, were also to be excluded. But in
spite of these orders, scarcely a day went by without bringing a
contingent of outsiders to the park; he believed that excursion trains
were run to Framsby solely to give the curious a chance of catching
a glimpse of the lady who figured as the heroine of “The Curious
Case” column of the great daily paper.
But as far as Framsby itself was concerned, it did not contribute
largely to the material of the nuisance. The truth was that the “sets”
of Framsby, who had for some days made the road to the Manor
suggest a picture of the retreat of the French from Moscow, owing to
their anxiety to leave cards upon the young couple, now stood
aghast at the information conveyed to them by the newspapers that
Mrs. Jack Wingfield was not really Mrs. Jack Wingfield. They stood
aghast, and held up their hands as if they were obeying the
imperative order of a highwayman rather than the righteous impulse
of outraged propriety. Some of them, who, through the strain put
upon the livery stables, had been compelled to postpone their visit
until a more convenient season, now affirmed that they had had
their doubts respecting the marriage all along. There was some
consultation among the “sets” as to the possibility of having their
visits cancelled, as now and again a presentation at Court was
cancelled. Would it not be possible to get back their cards? they
wondered. The baser sort had thoughts of sending in the livery
stables bill to Mr. Jack Wingfield.
But before a fortnight had passed it became plain to Jack and
Priscilla that they were not going to remain without sympathetic
visitors. Priscilla got a letter from Mrs. Bowlby-Sutherst—a vivacious
letter, and a delightfully worldly one into the bargain. The writer
stated her intention of coming to lunch at the Manor House the next
day, and of bringing a fire escape with her to allow of her getting in
by one of the windows if she were refused admission by the door.
And when she came and was admitted without the need for the
display of any ingenuity on her part, she proved a most amusing
visitor, showing no reticence whatever in regard to the “case,” and
ridiculing the claims of Marcus Blaydon to conjugal rights, after the
way he had behaved. Of course everyone with any sense
acknowledged, she affirmed, that the marriage was between Jack
and Priscilla.
When she had gone away Priscilla wondered if there was anything
in what she had said on this point; and Jack replied that he was
afraid that Mrs. Bowlby-Sutherst was too notorious as a patron of
notoriety for her opinion to have much weight. But as things turned
out, that was just where he was wrong, for within the week several
other ladies of considerable importance—county importance—called
at the Manor, and were admitted. These were people who owned
London houses and had a premonition that next season Mrs.
Wingfield—they were sure that she would be Mrs. Wingfield by then
—would be looked on as the most interesting figure in the world of
drawing-rooms; and Priscilla found them very nice indeed, referring
to her “case” as if it were one of the most amusing jests of the
autumn season. They showed no reluctance in talking about its
funniest features—its funniest features were just those which a rigid
disciplinarian would have called its most serious features—and they
promised faithfully that when she should appear in the court they
would be present to offer her their support—their moral support.
They seemed quite downhearted when she explained to them how it
was her hope that the arbitrament of the Divorce Division would be
avoided by a decree of a judge on the question of nullity. They had
quite set their hearts on the Divorce Court, and had in their eye a
toilet scheme which they felt sure would be in sympathy with the
entourage of that apartment, and to which they thought they might
be trusted to do justice.
But as the social position of these visitors was among the highest
in the county, Priscilla began to feel that there was no chance of her
becoming isolated even at the Manor House. The reasonableness of
her attitude appealed, she saw, to some reasonable people. She had
great hopes that it would appeal as well to one or more of His
Majesty’s judges when the time came.
And she was not neglected by her dear friend Rosa Cafifyn; but
this young woman came to her unaccompanied by her mother. The
Caffyn household was divided against itself on this vexed subject of
Priscilla’s attitude. Mrs. Caffyn, who had never encouraged her
daughter’s friendship for Priscilla Wadhurst, was aghast at the
publicity which her daughter’s friend had achieved.
“She was always getting herself talked about,” she remarked.
“First there was that affair with the prince; everyone was talking
about her speaking to him in French—in French, mind—for more
than an hour.” (Mrs. Caffyn seemed to have acquired the impression
that a conversation in French could scarcely fail to possess some of
the elements of the dialogue in a French vaudeville, and she had
heard enough about that form of composition to make her distrustful
of its improving qualities.) “And then,” she went on, “there came all
that horrid business about her marriage—the arrest of the man, you
know, and all that. The next thing was the trial, where her name
was mentioned in the hearing of all the common people—witnesses
and people of that class—in the court. Later on there was the heroic
drowning of the man, and then her marriage to Mr. Wingfield within
a few months, and the electioneering business—I really think that
she should have been more discreet than to get herself talked about
so frequently. As for her present escapade, I can only say that it
seems to me to be the crowning indiscretion of her life.”
But the Reverend Mr. Caffyn, who had been talking to his
patroness, Mrs. Bowlby-Sutherst, about Priscilla, was disposed to
take the view of an easy-going looker-on at the world and its ways
from a lesser altitude than that of his pulpit; and he smiled at
Priscilla’s resolution to remain at the Manor. He did not think that it
mattered much just then. Had she not married young Wingfield in
good faith, and had they not been going about together ever since?
he asked. He had in his mind, though his wife did not know it, the
saying of the wicked witty Frenchwoman who had accepted the
legend of the King’s making quite a promenade when deprived of his
head, on the plea that, after all “c’est le premier pas qui coûte.” And
so his daughter had no hesitation in paying her visit to the Manor.
It was when she was going through the gates that she recollected
how Priscilla had talked to her upon that morning long ago at this
same place. What had she said? Was it not that if she were to love a
man truly she would not allow any considerations of morality or any
other convention to keep her apart from him?
Rosa wondered if there really was anything in the theory which
was held by some people, to the effect that sometimes a judgment
followed hard upon the utterance of a thoughtless phrase. She
wondered if the publicity in which Priscilla was now moving had
been sent to her as a punishment for her impulsive words.
Perhaps it was the atmospheric envelope, so to speak, of this
thought which remained hanging about her in the house and
prevented her visit to her dear friend from being all that she
expected it to be. It was of course a delightful reunion; but
somehow Priscilla did not seem to be just the same as she had been
long ago.
With these variations of visitors and with plenty to occupy her
mind and her hands Priscilla found the weeks to go by rapidly
enough. She took care to be constantly occupied, by undertaking the
reorganization of the dairy in connection with the home farm, and
she had no difficulty in reviving Jack’s interest in the scheme for
introducing electric power for the lighting of the house and for the
lightening of labour in whatever department of the household labour
was employed. An expert on dynamos was summoned from
Manchester, and his opinion bore out all that Priscilla had said to
Jack on this interesting enterprise; and before a fortnight had
passed the details of the scheme had been decided on and estimates
were being prepared for the carrying out of the work.
In addition to her obvious duties Priscilla was making herself
indispensable to Jack’s mother in her long and tedious illness,
reading to her and sitting with her for hours every day. It was,
however, when Jack was alone with his mother one evening that she
laid her hand on his, saying:
“My dear boy, I had my fears at one time for the step you were
taking; but now I can only thank you with all my heart for having
given me a daughter after my own heart. I have, as you know,
always longed for a daughter, and my longing is now fulfilled with a
completeness that I never looked for. She is the best woman in the
world, Jack—the best woman for you.”
“I hope that I shall be able to make her as happy as she has made
me,” said he.
“Ah, that is the very point on which I wished to speak to you,” said
the mother. “I wonder if you have noticed—-if you have thought that
she is quite as happy as we could wish her to be. A shadow—no, not
quite so much as a shadow, but still something—have I been alone
in noticing it?—something like a shadow upon her now and then.”
Jack was slightly startled. He had taken good care that no
newspaper containing an allusion to the “curious case” which was
exciting the attention of all England and calling for immediate
attention on the other side of the Atlantic as well, should get into his
mother’s hands; but now that she was approaching convalescence,
he knew that however vigilant he might be in this respect, an
unlucky chance would make her aware of all that had happened
since the beginning of the attack that had prostrated her. He had
been living in dread of such a catastrophe all the previous week, and
now he perceived that it was imminent. Priscilla had not been able
to play her part so perfectly as to prevent the quick feeling—the
motherly apprehension—of the elder lady from suggesting
something to her.
“It would be the worst day of my life if any cloud were to come
over her path,” he said. “I hope that if anything of the sort were to
happen, it would only be a temporary thing—something that we
should look back upon, wondering that it should ever have disturbed
our peace.”
“What!” she cried. “You have noticed it?—there is something!—you
know what it is?”
“Oh, yes,” he said, with an affectation of carelessness “there has
been something—a trifle really—nothing of the nature of a difference
between Priscilla and myself, but——”
“I am glad you can assure me of that—that it is not the result of
any difference between you,” said she. “I know that the first few
months of married life are usually the most trying to both the man
and the woman; but you can assure me that it is not——”
“I can give you such an assurance,” he replied. “There has not
been so much as a suspicion of difference between us in thought
since she entered this house—in fact, since she became my wife.”
“What is the matter, then? May I not know, Jack? Don’t tell me if it
is anything which concerns Priscilla and you only.”
“Dearest mother, there is nothing that can concern us without
being a matter of concern to you. Still, this one thing—of course you
must know it; but what I am afraid of is that you will attach too
much importance to it—that you will not see how it may be easily
cleared away.”
“You will tell me all about it, Jack, and I promise you not to think
of it except in the way you say I should.”
“It really is quite a simple thing—five minutes should clear it away
for ever; and so far from its standing between Priscilla and myself, it
will, I am sure, only draw us closer to each other.”
He was not an adept in the art of “breaking it gently”; he had
never had need to practise it. He felt that this, his first attempt, was
but an indifferent success; he could see that so far from soothing
her, his preliminary ambling around the subject was exciting her. And
yet he feared to come out with a bare statement of the facts. He
was snipping the end off a cigar; somehow he was clumsy over the
operation; he could not understand why until he found that he was
trying to force into the chamfered cutter the wrong end.
And his mother was noticing his confusion and becoming unduly
excited.
Fortunately at this moment Priscilla entered the room—it was Mrs.
Wingfield’s boudoir, a pretty apartment for an invalid, the windows
overlooking a garden of roses. Never did Jack so welcome her
approach. The moment she passed the door she knew what was
before her.
“Oh, by the way, Priscilla,” said he, “you may as well tell mother
just now all there is to be told about this disagreeable business. I
have said that it is unlikely to take up more than a few minutes of
the judge’s time. You can best do it alone, I know.”
He bolted.
His mother smiled, and Priscilla laughed outright; it was so like a
man—each knew that that was just what the other was thinking
—“so like a man!”
The elder lady’s smile was still on her face when Priscilla said:
“There’s really very little to be told about this disagreeable affair;
but it must be faced. The fact is that we are applying to a judge to
have my first marriage—that shocking mockery of a marriage—
annulled, and everybody says that there will be no difficulty
whatever about it.”
“I don’t suppose that there should be any difficulty, my dear,” said
Mrs. Wingfield. “But what would be the good of it?”
“Something has happened which makes it absolutely necessary,”
replied Priscilla. “But it is really the case that what has happened will
make it very much easier for the judge. The wretch who, with a
charge of fraud hanging over him, did not hesitate to make the
attempt to involve me in his ruin, went straight from the gaol to
America.”
Mrs. Wingfield nodded.
“Don’t trouble yourself, dear,” she said. “I know all the story; it is
not all squalid; you must not forget that he died trying to save the
others.”
“That was his lie,” cried Priscilla. “He managed to get safely to the
shore and he turned up here trying to get money out of us to buy
him off. Jack showed him the door pretty quickly; so now you can
understand how necessary it is that we should have the marriage
nullified. A judge can do it in five minutes. Jack has been to Liscomb
and Liscomb, and they told him so.” (She was not now giving
evidence in a court of law.) “Oh, yes; they had the opinion of Sir
Edward upon it—five minutes! But in the meantime——”
“That’s it—in the meantime,” said Mrs. Wingfield slowly. She
seemed trying to think out some point of great difficulty which had
presented itself to her mind.
“In the meantime,” she repeated. “Am I right, Priscilla, in the
meantime you—you——”
“In the meantime, my dearest mother, if Jack were to die, and in
his will refer to me as his wife, the judge of the Probate Court would
decide that I should get whatever that will left to me. Is there
anyone who will say that I am not Jack’s wife? You will not say it,
and you are Jack’s mother.”
“I certainly will not say it, Priscilla; but still—there are some who
would say it, and—in the meantime—oh, it is terrible! my poor child;
it is no wonder that there was a shadow cast upon your life. What
you must have suffered—what you must still suffer! and how bravely
you bore your burden in front of me!”
Priscilla had flung herself on her knees beside the sofa, and put
her face down to the cushion on which the mother’s head was
resting; but her tears were not bitter, and her sobs were soft.
So she lay, her right arm about the shoulders of the other, for a
long time, in complete silence.
At last she raised her head from the cushion, and then bowed it
down to the pale face that was there until their tears mingled.
“I know what you are thinking, dearest,” she whispered. “You are
thinking that in the meantime I should not be in this house. Is not
that so? Oh, I knew that that was your thought; but it will not be
your thought when I tell you that....”
Her whisper dwindled away into nothing—it was not louder than
the breathing of a baby when asleep.
But the elder woman caught every word. She gave a little cry of
happiness, and held Jack’s wife close to her, kissing her again and
again.
“Dearest,” she said, “you are right; your place is here—here—in
the meantime.”
CHAPTER XXXIII
I
n spite of the very good case which Priscilla had made out for
herself to Jack’s mother, without deviating from strict accuracy
more widely than could easily be pardoned by even the severest
moralist, and in spite also of the still better case which was made
out for her by some of the contributors to that holiday page of the
newspapers, she felt that she had considerable cause for uneasiness
as the weeks went by and Messrs. Liscomb and Liscomb, having
returned from Scotland or Homburg, were busying themselves about
the nullity suit. Incidentally, they were concerned in two very dainty
divorce suits and three libel actions which they hoped to get on the
list before Christmas. They let Jack know that a defence had been
entered to the nullity suit by Mr. Marcus Blaydon, so that the
petitioner should not have a walk-over, whatever might happen; and
they urged on Mr. Wingfield the necessity for finding out whether all
that Captain Lyman knew would be in favour of Priscilla or of Marcus
Blaydon.
It was apparent that what Captain Lyman knew would be an
important factor in the case; but what he did know he had no
chance of revealing, for it seemed as if Captain Lyman was lost. His
name was in the registry of certificated mariners, but it was there as
the master of the barque Kingsdale, and the owners of that ill-fated
craft, on being communicated with by Messrs. Liscomb and Liscomb,
stated that he was no longer in their service, nor did they know
whose employment he had entered after the loss of his vessel.
During the whole of the month of August the solicitors had, through
their agents, been endeavouring to trace Lyman, but they had met
with no success. The barque Kingsdale had been owned in Quebec,
and he had been seen in that city in the month of June, but since
then his whereabouts had been vague; and the clerk who was ready
to rush off at a moment’s notice in search of him, and to fathom the
mystery of what he knew, began to feel that he stood a very good
chance of being deprived of his excursion.
Messrs. Liscomb and Liscomb were beginning to write rather grave
letters, They reminded Jack that they had absolutely no evidence to
show that Blaydon had gone away from the English gaol to meet
another woman than his wife; and as this was an important fact to
establish both in the nullity suit and the possible divorce suit, and as,
apparently, no one but Captain Lyman could give evidence on this
point—a question which had not yet been answered—they thought
no stone should be left unturned in order to find him and learn from
his own lips what it was that he knew, and how much of it he did
actually know, and whether his knowledge should take the form of
an affidavit, or be carefully suppressed.
As a matter of fact Messrs. Liscomb and Liscomb gave Mr.
Wingfield to understand that the success of their case would be
seriously jeopardized unless they could place some evidence before
the judge bearing upon the object of that trip made by Marcus
Blaydon across the Atlantic.
Jack did not question the accuracy of their opinion in this matter;
but what was he to do to provide them with the evidence they
required? It was all very well for them to write about the necessity
for leaving no stone unturned in order to find the extent of Captain
Lyman’s knowledge; but how could he, Jack Wingfield, travel
through the world during the next couple of months, turning over
stones to see if Captain Lyman was concealed beneath one of them?
He felt greatly disappointed, but he took good care that Priscilla
remained in ignorance of the purport of Messrs. Liscomb and
Liscomb’s letters, and every day made it harder for him to keep her
in this condition.
One afternoon he drove with her into Framsby, and their carriage
stopped at a shop almost exactly opposite to the Corn Exchange,
just when the frequenters of that institution were standing in groups
along the pavement on the one day of the week when the Exchange
was open. Business had been exceptionally good that day, and most
of the farmers and millers were in a good humour. As soon as the
rumour went round that the handsome lady in the carriage was the
daughter of Farmer Wadhurst who was “standing up for her rights”—
that was the precis that reached them of the “curious case” of the
newspaper page—they took off their hats and gave her a hearty
cheer.
This was not the first time that Priscilla had been so greeted in
Framsby; but such proofs of the position she occupied in the hearts
of the people, though gratifying, when considered from one
standpoint, did not throw the light that was needed upon the
question of what stone would, when turned, reveal the form of
Captain Lyman ready to make an affidavit that should have weight
with a judge. So while Priscilla drove home gratified by the kindly
spirit shown by her sympathisers, Jack could not help feeling that he
would gladly have exchanged it all for a single statement, made in
the presence of a commissioner for taking oaths, bearing out the
admission of Marcus Blaydon in regard to that woman on the other
side of the Atlantic.
Of course Priscilla quickly perceived that he was becoming uneasy,
and equally as a matter of course she found out the cause of the
uneasiness. He told her something of what Messrs. Liscomb and
Liscomb had communicated to him, though he did not go so far as
to let her know that they considered the absent evidence to be vital
to the success of the petition.
She took his explanation without saying more than a word or two.
“If Captain Lyman is not to be found we cannot have his evidence,
whether for us or against us,” she said. “And that being so, we shall
have to do our best without it. I have great faith in Sir Edward’s
power of cross-examining. If he puts that man in the witness-box he
should be able to get him to confess as much as he did to you.”
Jack did not tell her that Messrs. Liscomb and Liscomb had
explained to him that perhaps Marcus Blaydon might be prevented
from going into the box by his own advisers, who might think it
advisable to let the judge say whether or not she had succeeded in
establishing her petition when she had been examined before him. It
was well known that a very strong case indeed required to be made
out in favour of pronouncing a marriage null and void before a judge
would make such a pronouncement. So Messrs. Liscomb and
Liscomb had told him; but he kept this information to himself.
It was with that phrase about leaving no stone unturned ringing in
his mind, as if it were Messrs. Liscomb and Liscomb’s telephone bell,
that he sent off to the governor of the prison where Marcus Blaydon
had been incarcerated the postcard which contained upon its gummy
surface the imprint of the finger-tips of the man who had visited the
Manor claiming Priscilla as his wife. In spite of the absolute certainty
of Priscilla that he was Marcus Blaydon, Jack thought that there was
just a chance that he was an impostor. Even within his experience
there had been cases of men impersonating others with a view to
blackmail or to an inheritance. There was just a chance that this
man was not the real Marcus Blaydon, but a scoundrel of a slightly
different pattern.
He sent the card in a small box, enclosing with it a letter asking
the governor to be good enough to let him know if the finger-prints
that it bore were those of Marcus Blaydon, who had been
incarcerated in the prison for over a year.
With the lapse of only a few posts he received a communication
from the acting-governor of the prison stating that he had sent on
the card to the Criminal Investigation Department, and that the reply
had been that the prints were those of Marcus Blaydon.
He told Priscilla what he had done, and what was the result, and
she shook her head and smiled.
“It was very clever of you to get the finger-prints as you did,” she
said. “But I knew that I could not be mistaken in the man.”
“There was only the ghost of a chance that the man was an
impostor,” said Jack; “but I felt bound to leave no stone—oh, there’s
that phrase buzzing about me again!”
“You were quite right, dear Jack,” she said. “No stone should be
left unturned in digging the foundation for our case.”
Nothing further passed between them on this point; but two days
later Jack received a private letter from the governor of the prison,
stating that he had just resumed his duty after taking his annual
leave, and that he had seen the letter which his deputy had
answered.
“I can easily understand that you should be interested in an
enquiry of the nature of that suggested by your communication,” he
added; “and though the reply which was sent to you may not have
been just the one for which you hoped, yet I think it possible that it
may be in my power to give you some assistance in any
investigation you or your lawyers may be making in regard to Marcus
Blaydon. It would not be regular to do so by letter, but if you could
make it convenient to pay me a visit I might be able to place you in
possession of one or two interesting—perhaps they may even turn
out to be important—facts which came to my knowledge respecting
the man when he was in my charge.
“When I read in the English newspapers, which I received in
Switzerland, the particulars of the case in which Marcus Blaydon
played so sinister a part, I made up my mind to place myself in
communication with you; and I would have done so even if your
letters had not been put into my hands on my return.”
“It may mean a great deal or it may mean nothing,” remarked
Jack, passing this communication on to Priscilla.
Of course, Priscilla felt inclined, on a first reading of the note, to
attribute a great deal of importance to it. “Why should the prison
official take the trouble to write asking you to meet him if he was
not sure that what he had to say was vital?” she asked Jack. But a
second reading caused her to be less sanguine.
“It is just as you say it is: the man is guarded in his words; they
may mean a great deal or they may mean very little,” she said. “But
he is in an official position, and no doubt he has had experience of
curious cases and of everything that has a bearing upon them; and I
can’t think that he would have taken the trouble to write to you or to
ask you to visit him unless he had something important to tell you.”
“He says it may turn out to be important,” said Jack; “but just now
he thinks that it is only interesting. I am inclined to believe that it
will never get beyond that qualification. You see, if he himself had
thought that what he knew was vital to our interests he would have
telegraphed to us the moment the first newspapers came into his
hands.”
“Yes, that is so, I can see plainly; but anyhow, you’ll go, will you
not?” said Priscilla. She could see plainly that J ack was a little
annoyed because nothing had come of his cleverly-contrived trap in
obtaining the man’s finger-prints. He was not disposed to have any
extravagant hopes of important information coming from a quarter
that had failed him before. She knew that he was unreasonable; but
she also knew that it was quite natural for him to be affected as he
was by the failure of the authorities to say that the finger-prints
were those of some man other than Marcus Blaydon.
“Great Gloriana! Of course I shall go to see him, and you will
come with me,” cried Jack. “No matter what he has to say to us, I
feel that no stone——”
Priscilla clapt her hands upon her ears and rushed out of the
room.
The county gaol to which Marcus Blaydon had been committed
was a long way from Framsby. To reach it necessitated a journey to
London, and thence into the heart of the Midlands. Passing through
London they called upon Messrs. Liscomb and Liscomb to tell them
of their mission, and the junior partner, who was acquainted with
Major Crosbie, the governor of the prison, became greatly interested
in the letter which he had written to Jack—so interested, indeed,
that if the duty had not been laid upon him of receiving professional
visits from two most promising prospective co-respondents and
three defendants of newspaper libel actions, to say nothing of
sundry uncompromising plaintiffs, he would, he declared, accompany
his clients into the very presence of Major Crosbie.
“Whatever he may have to communicate, you may be sure that it
will have a bearing upon the case,” he said. “He will put you on the
track of evidence—real evidence—not merely what somebody said
that somebody told somebody else. You know where we are
deficient in this particular.”
“Yes,” said Jack quickly, being afraid that he might go on to
express himself strongly in Priscilla’s presence regarding the need for
evidence on the object of Blaydon’s trip across the Atlantic. “Yes, we
know pretty well how we stand. Any proof that Blaydon was a
blackguard will be received with gratitude.”
“That’s it,” said Mr. Liscomb.
“I thought Sir Edward’s cross-examination might be expected to
do great things for us in this way,” said Priscilla.
“It may do something, but not a great deal,” said Liscomb.
“Judges are fond of facts; they don’t care much about cross-
examinations, however brilliant the newspapers may call them. You
can easily see how the fellow, now that he has been put on his
guard by your hint that you mean to try to connect his voyage with a
woman, will be careful to have a story ready to account for all his
movements, and he has only to stick to it to pull through, however
Sir Edward may browbeat him. If you can bring the woman into
court we shall have him in the cart.”
That was all that Mr. Liscomb had to say to them, and they began
to feel that they might as well have gone on direct to the gaol
instead of calling upon him. And that was exactly what Mr. Liscomb
himself thought. The honour and glory of being associated with the
“curious case” were not inordinately estimated by him; the firm had
been so closely connected with such a number of other curious
cases ever since he had become a partner.
They found Major Crosbie waiting for them in a private room at
the governor’s house. As he was somewhat irregular in offering them
the information of which he was possessed, he was too strict a
disciplinarian to receive them in an official apartment. Within the
precincts of his private residence he felt himself at liberty to talk as
he pleased. A conscience capable of such reasonable differentiation
is most valuable in an official.
He waved aside in a graceful way Mr. Wingfield’s expression of
gratitude for the invitation to this interview.
“There is no need to say a word on this point, Mr. Wingfield,” he
said. “Your case is a most curious one.”
Jack confessed that he had heard it so described.
“A very curious one. It had been for nearly a week in the papers
before I had a chance of hearing anything about it; but when I
heard the name Marcus Blaydon I at once recollected some
particulars which had come under my notice officially in connection
with that man Blaydon. You are aware that it is part of my duty to
read not only those letters which the prisoners in my charge write to
persons outside, but also those which are received for themselves.
Now, Blaydon received while in this prison four letters, all of which
had been addressed to him at Prangborough, where, as you
doubtless know, he lived.”
Priscilla assented. Prangborough was the town in which her Aunt
Emily lived.
“They had been addressed to him at Prangborough, and from
there were forwarded to the prison. I find by reference to my official
diary that three of them came from apparently the same
correspondent and were posted at the same place—London in
Canada; they were signed ‘Lucy.’ The fourth was from a man,
evidently a captain in the merchant service, named Horace Lyman. It
had been posted at Sunderland, and was received by me a short
time before the expiration of the man’s term of imprisonment.”
“That is the letter which would be of importance to us if it told us
what is the present address of Captain Lyman,” said Jack.
Major Crosbie shook his head.
“You cannot expect a letter written nearly seven months ago to
state positively what is the writer’s address to-day,” said he with a
laugh. “But the contents of that letter made it clear that the writer
and his correspondent were not on the best terms; and that the
reason of this was the ill-treatment by Blaydon of the writer’s sister,
whose name was Lucy.”
“And the woman’s letters—did they make anything clear?”
“The woman’s three letters made a good deal clear. The one of
the earliest date suggested very clearly that she was the man’s wife.”
“What, Blaydon’s wife!” cried Jack. “That would be the best
possible news for us.”
“So it occurred to me,” said Major Crosbie. “If the man had been
married—as the letters suggested he was—some years before he
came under my notice—under our notice, I should say—and if his
wife was alive, as she must have been when those letters of hers
were written, the curious case becomes a very simple case indeed.”
“And the letters suggested marriage?” said Priscilla, interrogatively.
“They undoubtedly suggested marriage—at least, they would have
done so to someone with a smaller experience than I have had of
such correspondence. But from what I know I should say that to
assume that because a woman addresses a man as ‘My own
husband,’ she is that man’s lawful wife, would be a very unwise thing
to do. Such a form of address, I have learnt by experience, comes
quite naturally to the woman who is not married to the man but who
should be on the grounds of the most elementary morality. It is the
form used by the woman who has been deserted by the man, but
who hopes to get back to her former place in his affection. She
seems to think, poor thing, that if she assumes the title of wife
whenever she has the chance, she will in time come to feel that she
is his wife. I am not sure if you recognize the—the—what shall I call
it?—the naturalness of all this.”
He glanced first at Jack and then at Priscilla, and paused as if for
their acquiescence in his suggestion.
They acquiesced. Jack nodded and muttered “Quite so.” Priscilla
said:
“I am sure it is natural—it is quite plausible. But it might be
possible, might it not? to gather from the rest of the letters whether
the woman was trying to bring back a husband or a lover.”
“It is sometimes a good deal more difficult to do so than you could
imagine,” replied the Governor. “I used to think that I could
determine this point by the character of the letters; the most earnest
letters—those that were the most loving—the most full of
endearment—were written by the woman to her lover; the tamest—
the most formal, with a touch of nasty upbraiding, came from the
legal wife to her legal husband. That was the general principle on
which I drew my conclusions; but I soon found out how easy it was
to make a mistake by building on such foundations only. You see,
women differ so amazingly in temper and in temperament, leaving
education and ‘the complete letter-writer’ out of the question
altogether, that a wife who is not quite a wife may be carried away
by her feelings of the moment, and say something so bitter that you
could only believe it to come from a true wife, and the true wife may
be really in love with her husband, and ready to condone his lapses
without a word of reproach. That is how it is quite easy for one to
make a mistake in trying to differentiate on the basis of
correspondence only.”
“Quite so,” muttered Jack.
“I can quite believe that,” said Priscilla. “But about these particular
letters?”
She thought it quite as well to bring back Major Crosbie from his
consideration of the abstract to that of the concrete. She could see
that Jack was becoming slightly impatient at the somewhat cynical
expression of the Governor’s experiences.
“I was just returning to the letters written to Marcus Blaydon,” said
he. “It was necessary for me to state to you the difficulty which I
find in the way of coming to any legitimate conclusion on the point
which concerns you most, in order to prevent you from falling into
the mistake of believing that you are quite safe, when investigation
may prove that you have assumed too much.”
“Of course—quite right,” said Jack. “But you believe that the
woman was his wife?”
The Governor caressed his chin with a neat forefinger.
“I think, after going very carefully once more over the copy of the
letters, that there would be sufficient in any one of them to allow a
Grand Jury to bring in a true bill,” he replied.
Jack saw that the man described very neatly what was in his
mind. But Priscilla had never served on a Grand Jury. She required
further explanation.
“What I mean to say,” resumed Major Crosbie, “is that the letters
suggest a relationship which may prove on investigation to be a legal
union contracted three years ago in Canada. You observe how
cautious I am?”
“I do indeed,” replied Priscilla, and she did not acquiesce merely
out of politeness.
“I should be reluctant to say one word that might lead you to
expect too much,” said he. “My experience leads me to look for the
worst and not the best in men; but I should be reluctant to say that
the letters signed ‘Lucy’ did not come from a woman who was the
legal wife of Marcus Blaydon.”
“That is so much, at any rate,” said Jack; “and now if you can give
us any clue as to how it would be possible to be brought in touch
with Horace Lyman, we will be evermore indebted to you.”
“The woman is his sister—so much I gathered,” said the Governor.
“And I learned that he was waiting for Blaydon at the prison gate
when Blaydon was released. That is all I know. But the sister’s
address is, as I mentioned just now, London, in Canada—at least,
that was her address when she was in communication with Blaydon.
Her letters were not illiterate, though of course they were not
carefully written. They showed what critics would possibly call an ill-
balanced mind—extremes of blandishments on one page, and
threats of the wildest nature on the next. I can give you copies if
you would care to see them.”
Priscilla shook her head. She could not see herself sitting down to
read the confidential letters of the poor woman.
“I am quite willing to accept your judgment on them, Major
Crosbie,” she said.
“I think that you are right to do so,” said he. “If you were to, read
them they would certainly convey more to you, who have fortunately