100% found this document useful (11 votes)
56 views

PDF C++ How to Program Early Objects Version 9th Edition (eBook PDF) download

Program

Uploaded by

bareziitier
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (11 votes)
56 views

PDF C++ How to Program Early Objects Version 9th Edition (eBook PDF) download

Program

Uploaded by

bareziitier
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Visit https://ebookluna.

com to download the full version and


explore more ebooks

C++ How to Program Early Objects Version 9th Edition


(eBook PDF)

_____ Click the link below to download _____


https://ebookluna.com/product/c-how-to-program-early-
objects-version-9th-edition-ebook-pdf/

Explore and download more ebooks at ebookluna.com


Here are some recommended products that might interest you.
You can download now and explore!

(eBook PDF) Java How To Program (Early Objects) 10th

https://ebookluna.com/product/ebook-pdf-java-how-to-program-early-
objects-10th/

ebookluna.com

(eBook PDF) Java How to Program, Early Objects 11th


Edition by Paul J. Deitel

https://ebookluna.com/product/ebook-pdf-java-how-to-program-early-
objects-11th-edition-by-paul-j-deitel/

ebookluna.com

C How to Program 9th Edition Deitel Paul - eBook PDF

https://ebookluna.com/download/c-how-to-program-ebook-pdf/

ebookluna.com

C++ How to Program: An Objects-Natural Approach, 11e 11th


Edition Paul Deitel - eBook PDF

https://ebookluna.com/download/c-how-to-program-an-objects-natural-
approach-11e-ebook-pdf/

ebookluna.com
C How to Program, 9th Global Edition Deitel Paul - eBook
PDF

https://ebookluna.com/download/c-how-to-program-9th-global-edition-
ebook-pdf/

ebookluna.com

(eBook PDF) Starting Out with C++: Early Objects 9th


Edition

https://ebookluna.com/product/ebook-pdf-starting-out-with-c-early-
objects-9th-edition/

ebookluna.com

(eBook PDF) Java How to Program, Late Objects Global


Edition 11th Edition

https://ebookluna.com/product/ebook-pdf-java-how-to-program-late-
objects-global-edition-11th-edition/

ebookluna.com

Starting Out with C++: Early Objects 9th Edition by Tony


Gaddis (eBook PDF)

https://ebookluna.com/product/starting-out-with-c-early-objects-9th-
edition-by-tony-gaddis-ebook-pdf/

ebookluna.com

(eBook PDF) C How to Program, Global Edition 8th by Paul


Deitel

https://ebookluna.com/product/ebook-pdf-c-how-to-program-global-
edition-8th-by-paul-deitel/

ebookluna.com
Trademarks
DEITEL, the double-thumbs-up bug and DIVE INTO are registered trademarks of Deitel and Associates,
Inc.
Carnegie Mellon Software Engineering Institute™ is a trademark of Carnegie Mellon University.
CERT® is registered in the U.S. Patent and Trademark Office by Carnegie Mellon University.
Microsoft® and Windows® are registered trademarks of the Microsoft Corporation in the U.S.A. and
other countries. Screen shots and icons reprinted with permission from the Microsoft Corporation. This
book is not sponsored or endorsed by or affiliated with the Microsoft Corporation.
UNIX is a registered trademark of The Open Group.

Throughout this book, trademarks are used. Rather than put a trademark symbol in every occurrence of
a trademarked name, we state that we are using the names in an editorial fashion only and to the benefit
of the trademark owner, with no intention of infringement of the trademark.
Contents
Chapters 24–26 and Appendices F–K are PDF documents posted online at the book’s
Companion Website, which is accessible from www.pearsonhighered.com/deitel.

Preface xxi

1 Introduction to Computers and C++ 1


1.1 Introduction 2
1.2 Computers and the Internet in Industry and Research 2
1.3 Hardware and Software 5
1.3.1 Moore’s Law 6
1.3.2 Computer Organization 6
1.4 Data Hierarchy 7
1.5 Machine Languages, Assembly Languages and High-Level Languages 9
1.6 C++ 10
1.7 Programming Languages 11
1.8 Introduction to Object Technology 14
1.9 Typical C++ Development Environment 17
1.10 Test-Driving a C++ Application 19
1.11 Operating Systems 25
1.11.1 Windows—A Proprietary Operating System 25
1.11.2 Linux—An Open-Source Operating System 26
1.11.3 Apple’s OS X; Apple’s iOS for iPhone®, iPad® and
iPod Touch® Devices 26
1.11.4 Google’s Android 27
1.12 The Internet and World Wide Web 27
1.13 Some Key Software Development Terminology 29
1.14 C++11 and the Open Source Boost Libraries 31
1.15 Keeping Up to Date with Information Technologies 32
1.16 Web Resources 33

2 Introduction to C++ Programming;


Input/Output and Operators 38
2.1 Introduction 39
viii Contents

2.2 First Program in C++: Printing a Line of Text 39


2.3 Modifying Our First C++ Program 43
2.4 Another C++ Program: Adding Integers 44
2.5 Memory Concepts 48
2.6 Arithmetic 49
2.7 Decision Making: Equality and Relational Operators 53
2.8 Wrap-Up 57

3 Introduction to Classes, Objects and Strings 66


3.1 Introduction 67
3.2 Defining a Class with a Member Function 67
3.3 Defining a Member Function with a Parameter 70
3.4 Data Members, set Member Functions and get Member Functions 74
3.5 Initializing Objects with Constructors 79
3.6 Placing a Class in a Separate File for Reusability 83
3.7 Separating Interface from Implementation 87
3.8 Validating Data with set Functions 92
3.9 Wrap-Up 97

4 Control Statements: Part 1; Assignment,


++ and -- Operators 104
4.1 Introduction 105
4.2 Algorithms 105
4.3 Pseudocode 106
4.4 Control Structures 107
4.5 if Selection Statement 110
4.6 if…else Double-Selection Statement 112
4.7 while Repetition Statement 116
4.8 Formulating Algorithms: Counter-Controlled Repetition 118
4.9 Formulating Algorithms: Sentinel-Controlled Repetition 124
4.10 Formulating Algorithms: Nested Control Statements 134
4.11 Assignment Operators 139
4.12 Increment and Decrement Operators 140
4.13 Wrap-Up 143

5 Control Statements: Part 2; Logical Operators 157


5.1 Introduction 158
5.2 Essentials of Counter-Controlled Repetition 158
5.3 for Repetition Statement 159
Contents ix

5.4 Examples Using the for Statement 163


5.5 do…while Repetition Statement 168
5.6 switch Multiple-Selection Statement 169
5.7 break and continue Statements 178
5.8 Logical Operators 180
5.9 Confusing the Equality (==) and Assignment (=) Operators 185
5.10 Structured Programming Summary 186
5.11 Wrap-Up 191

6 Functions and an Introduction to Recursion 201


6.1 Introduction 202
6.2 Program Components in C++ 203
6.3 Math Library Functions 204
6.4 Function Definitions with Multiple Parameters 205
6.5 Function Prototypes and Argument Coercion 210
6.6 C++ Standard Library Headers 212
6.7 Case Study: Random Number Generation 214
6.8 Case Study: Game of Chance; Introducing enum 219
6.9 C++11 Random Numbers 224
6.10 Storage Classes and Storage Duration 225
6.11 Scope Rules 228
6.12 Function Call Stack and Activation Records 231
6.13 Functions with Empty Parameter Lists 235
6.14 Inline Functions 236
6.15 References and Reference Parameters 237
6.16 Default Arguments 240
6.17 Unary Scope Resolution Operator 242
6.18 Function Overloading 243
6.19 Function Templates 246
6.20 Recursion 248
6.21 Example Using Recursion: Fibonacci Series 252
6.22 Recursion vs. Iteration 255
6.23 Wrap-Up 258

7 Class Templates array and vector;


Catching Exceptions 278
7.1 Introduction 279
7.2 arrays 279
7.3 Declaring arrays 281
x Contents

7.4 Examples Using arrays 281


7.4.1 Declaring an array and Using a Loop to Initialize
the array’s Elements 281
7.4.2 Initializing an array in a Declaration with an
Initializer List 282
7.4.3 Specifying an array’s Size with a Constant Variable
and Setting array Elements with Calculations 283
7.4.4 Summing the Elements of an array 286
7.4.5 Using Bar Charts to Display array Data Graphically 286
7.4.6 Using the Elements of an array as Counters 288
7.4.7 Using arrays to Summarize Survey Results 289
7.4.8 Static Local arrays and Automatic Local arrays 291
7.5 Range-Based for Statement 293
7.6 Case Study: Class GradeBook Using an array to Store Grades 295
7.7 Sorting and Searching arrays 302
7.8 Multidimensional arrays 304
7.9 Case Study: Class GradeBook Using a Two-Dimensional array 307
7.10 Introduction to C++ Standard Library Class Template vector 314
7.11 Wrap-Up 320

8 Pointers 334
8.1 Introduction 335
8.2 Pointer Variable Declarations and Initialization 335
8.3 Pointer Operators 337
8.4 Pass-by-Reference with Pointers 339
8.5 Built-In Arrays 344
8.6 Using const with Pointers 346
8.6.1 Nonconstant Pointer to Nonconstant Data 347
8.6.2 Nonconstant Pointer to Constant Data 347
8.6.3 Constant Pointer to Nonconstant Data 348
8.6.4 Constant Pointer to Constant Data 349
8.7 sizeof Operator 350
8.8 Pointer Expressions and Pointer Arithmetic 353
8.9 Relationship Between Pointers and Built-In Arrays 355
8.10 Pointer-Based Strings 358
8.11 Wrap-Up 361

9 Classes: A Deeper Look; Throwing Exceptions 377


9.1 Introduction 378
Contents xi

9.2 Time Class Case Study 379


9.3 Class Scope and Accessing Class Members 385
9.4 Access Functions and Utility Functions 386
9.5 Time Class Case Study: Constructors with Default Arguments 387
9.6 Destructors 393
9.7 When Constructors and Destructors Are Called 393
9.8 Time Class Case Study: A Subtle Trap—Returning a
Reference or a Pointer to a private Data Member 397
9.9 Default Memberwise Assignment 400
9.10 const Objects and const Member Functions 402
9.11 Composition: Objects as Members of Classes 404
9.12 friend Functions and friend Classes 410
9.13 Using the this Pointer 412
9.14 static Class Members 418
9.15 Wrap-Up 423

10 Operator Overloading; Class string 433


10.1 Introduction 434
10.2 Using the Overloaded Operators of Standard Library Class string 435
10.3 Fundamentals of Operator Overloading 438
10.4 Overloading Binary Operators 439
10.5 Overloading the Binary Stream Insertion and Stream Extraction
Operators 440
10.6 Overloading Unary Operators 444
10.7 Overloading the Unary Prefix and Postfix ++ and -- Operators 445
10.8 Case Study: A Date Class 446
10.9 Dynamic Memory Management 451
10.10 Case Study: Array Class 453
10.10.1 Using the Array Class 454
10.10.2 Array Class Definition 458
10.11 Operators as Member vs. Non-Member Functions 466
10.12 Converting Between Types 466
10.13 explicit Constructors and Conversion Operators 468
10.14 Overloading the Function Call Operator () 470
10.15 Wrap-Up 471

11 Object-Oriented Programming: Inheritance 482


11.1 Introduction 483
11.2 Base Classes and Derived Classes 483
xii Contents

11.3 Relationship between Base and Derived Classes 486


11.3.1 Creating and Using a CommissionEmployee Class 486
11.3.2 Creating a BasePlusCommissionEmployee Class
Without Using Inheritance 491
11.3.3 Creating a CommissionEmployee–
BasePlusCommissionEmployee Inheritance Hierarchy 497
11.3.4 CommissionEmployee–BasePlusCommissionEmployee
Inheritance Hierarchy Using protected Data 501
11.3.5 CommissionEmployee–BasePlusCommissionEmployee
Inheritance Hierarchy Using private Data 504
11.4 Constructors and Destructors in Derived Classes 509
11.5 public, protected and private Inheritance 511
11.6 Software Engineering with Inheritance 512
11.7 Wrap-Up 512

12 Object-Oriented Programming: Polymorphism 517


12.1 Introduction 518
12.2 Introduction to Polymorphism: Polymorphic Video Game 519
12.3 Relationships Among Objects in an Inheritance Hierarchy 519
12.3.1 Invoking Base-Class Functions from Derived-Class Objects 520
12.3.2 Aiming Derived-Class Pointers at Base-Class Objects 523
12.3.3 Derived-Class Member-Function Calls via
Base-Class Pointers 524
12.3.4 Virtual Functions and Virtual Destructors 526
12.4 Type Fields and switch Statements 533
12.5 Abstract Classes and Pure virtual Functions 533
12.6 Case Study: Payroll System Using Polymorphism 535
12.6.1 Creating Abstract Base Class Employee 536
12.6.2 Creating Concrete Derived Class SalariedEmployee 540
12.6.3 Creating Concrete Derived Class CommissionEmployee 542
12.6.4 Creating Indirect Concrete Derived Class
BasePlusCommissionEmployee 544
12.6.5 Demonstrating Polymorphic Processing 546
12.7 (Optional) Polymorphism, Virtual Functions and Dynamic
Binding “Under the Hood” 550
12.8 Case Study: Payroll System Using Polymorphism and Runtime
Type Information with Downcasting, dynamic_cast, typeid
and type_info 553
12.9 Wrap-Up 557
Contents xiii

13 Stream Input/Output: A Deeper Look 562


13.1 Introduction 563
13.2 Streams 564
13.2.1 Classic Streams vs. Standard Streams 564
13.2.2 iostream Library Headers 565
13.2.3 Stream Input/Output Classes and Objects 565
13.3 Stream Output 567
13.3.1 Output of char * Variables 568
13.3.2 Character Output Using Member Function put 568
13.4 Stream Input 569
13.4.1 get and getline Member Functions 569
13.4.2 istream Member Functions peek, putback and ignore 572
13.4.3 Type-Safe I/O 572
13.5 Unformatted I/O Using read, write and gcount 572
13.6 Introduction to Stream Manipulators 573
13.6.1 Integral Stream Base: dec, oct, hex and setbase 574
13.6.2 Floating-Point Precision (precision, setprecision) 574
13.6.3 Field Width (width, setw) 576
13.6.4 User-Defined Output Stream Manipulators 577
13.7 Stream Format States and Stream Manipulators 578
13.7.1 Trailing Zeros and Decimal Points (showpoint) 579
13.7.2 Justification (left, right and internal) 580
13.7.3 Padding (fill, setfill) 582
13.7.4 Integral Stream Base (dec, oct, hex, showbase) 583
13.7.5 Floating-Point Numbers; Scientific and Fixed Notation
(scientific, fixed) 584
13.7.6 Uppercase/Lowercase Control (uppercase) 585
13.7.7 Specifying Boolean Format (boolalpha) 585
13.7.8 Setting and Resetting the Format State via
Member Function flags 586
13.8 Stream Error States 587
13.9 Tying an Output Stream to an Input Stream 590
13.10 Wrap-Up 590

14 File Processing 599


14.1 Introduction 600
14.2 Files and Streams 600
14.3 Creating a Sequential File 601
14.4 Reading Data from a Sequential File 605
14.5 Updating Sequential Files 611
xiv Contents

14.6 Random-Access Files 611


14.7 Creating a Random-Access File 612
14.8 Writing Data Randomly to a Random-Access File 617
14.9 Reading from a Random-Access File Sequentially 619
14.10 Case Study: A Transaction-Processing Program 621
14.11 Object Serialization 628
14.12 Wrap-Up 628

15 Standard Library Containers and Iterators 638


15.1 Introduction 639
15.2 Introduction to Containers 640
15.3 Introduction to Iterators 644
15.4 Introduction to Algorithms 649
15.5 Sequence Containers 649
15.5.1 vector Sequence Container 650
15.5.2 list Sequence Container 658
15.5.3 deque Sequence Container 662
15.6 Associative Containers 664
15.6.1 multiset Associative Container 665
15.6.2 set Associative Container 668
15.6.3 multimap Associative Container 669
15.6.4 map Associative Container 671
15.7 Container Adapters 673
15.7.1 stack Adapter 673
15.7.2 queue Adapter 675
15.7.3 priority_queue Adapter 676
15.8 Class bitset 677
15.9 Wrap-Up 679

16 Standard Library Algorithms 690


16.1 Introduction 691
16.2 Minimum Iterator Requirements 691
16.3 Algorithms 693
16.3.1 fill, fill_n, generate and generate_n 693
16.3.2 equal, mismatch and lexicographical_compare 695
16.3.3 remove, remove_if, remove_copy and remove_copy_if 697
16.3.4 replace, replace_if, replace_copy and
replace_copy_if 700
16.3.5 Mathematical Algorithms 702
16.3.6 Basic Searching and Sorting Algorithms 706
Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
Contents xv

16.3.7 swap, iter_swap and swap_ranges 710


16.3.8 copy_backward, merge, unique and reverse 711
16.3.9 inplace_merge, unique_copy and reverse_copy 714
16.3.10 Set Operations 716
16.3.11 lower_bound, upper_bound and equal_range 719
16.3.12 Heapsort 721
16.3.13 min, max, minmax and minmax_element 724
16.4 Function Objects 726
16.5 Lambda Expressions 729
16.6 Standard Library Algorithm Summary 730
16.7 Wrap-Up 732

17 Exception Handling: A Deeper Look 740


17.1 Introduction 741
17.2 Example: Handling an Attempt to Divide by Zero 741
17.3 Rethrowing an Exception 747
17.4 Stack Unwinding 748
17.5 When to Use Exception Handling 750
17.6 Constructors, Destructors and Exception Handling 751
17.7 Exceptions and Inheritance 752
17.8 Processing new Failures 752
17.9 Class unique_ptr and Dynamic Memory Allocation 755
17.10 Standard Library Exception Hierarchy 758
17.11 Wrap-Up 759

18 Introduction to Custom Templates 765


18.1 Introduction 766
18.2 Class Templates 766
18.3 Function Template to Manipulate a Class-Template
Specialization Object 771
18.4 Nontype Parameters 773
18.5 Default Arguments for Template Type Parameters 773
18.6 Overloading Function Templates 774
18.7 Wrap-Up 774

19 Custom Templatized Data Structures 777


19.1 Introduction 778
19.2 Self-Referential Classes 779
19.3 Linked Lists 780
xvi Contents

19.4 Stacks 794


19.5 Queues 799
19.6 Trees 803
19.7 Wrap-Up 811

20 Searching and Sorting 822


20.1 Introduction 823
20.2 Searching Algorithms 824
20.2.1 Linear Search 824
20.2.2 Binary Search 827
20.3 Sorting Algorithms 831
20.3.1 Insertion Sort 832
20.3.2 Selection Sort 834
20.3.3 Merge Sort (A Recursive Implementation) 837
20.4 Wrap-Up 843

21 Class string and String Stream Processing:


A Deeper Look 849
21.1 Introduction 850
21.2 string Assignment and Concatenation 851
21.3 Comparing strings 853
21.4 Substrings 856
21.5 Swapping strings 856
21.6 string Characteristics 857
21.7 Finding Substrings and Characters in a string 859
21.8 Replacing Characters in a string 861
21.9 Inserting Characters into a string 863
21.10 Conversion to Pointer-Based char * Strings 864
21.11 Iterators 865
21.12 String Stream Processing 867
21.13 C++11 Numeric Conversion Functions 870
21.14 Wrap-Up 871

22 Bits, Characters, C Strings and structs 879


22.1 Introduction 880
22.2 Structure Definitions 880
22.3 typedef 882
22.4 Example: Card Shuffling and Dealing Simulation 882
Contents xvii

22.5 Bitwise Operators 885


22.6 Bit Fields 894
22.7 Character-Handling Library 897
22.8 C String-Manipulation Functions 903
22.9 C String-Conversion Functions 910
22.10 Search Functions of the C String-Handling Library 915
22.11 Memory Functions of the C String-Handling Library 919
22.12 Wrap-Up 923

23 Other Topics 938


23.1 Introduction 939
23.2 const_cast Operator 939
23.3 mutable Class Members 941
23.4 namespaces 943
23.5 Operator Keywords 946
23.6 Pointers to Class Members (.* and ->*) 948
23.7 Multiple Inheritance 950
23.8 Multiple Inheritance and virtual Base Classes 955
23.9 Wrap-Up 959

List of Chapters on the Web 965

A Operator Precedence and Associativity 967

B ASCII Character Set 969

C Fundamental Types 970

D Number Systems 972


D.1 Introduction 973
D.2 Abbreviating Binary Numbers as Octal and Hexadecimal Numbers 976
D.3 Converting Octal and Hexadecimal Numbers to Binary Numbers 977
D.4 Converting from Binary, Octal or Hexadecimal to Decimal 977
D.5 Converting from Decimal to Binary, Octal or Hexadecimal 978
D.6 Negative Binary Numbers: Two’s Complement Notation 980
xviii Contents

E Preprocessor 985
E.1 Introduction 986
E.2 #include Preprocessing Directive 986
E.3 #define Preprocessing Directive: Symbolic Constants 987
E.4 #define Preprocessing Directive: Macros 987
E.5 Conditional Compilation 989
E.6 #error and #pragma Preprocessing Directives 990
E.7 Operators # and ## 991
E.8 Predefined Symbolic Constants 991
E.9 Assertions 992
E.10 Wrap-Up 992

List of Appendices on the Web 997

Index 999

Online Chapters and Appendices


Chapters 24–26 and Appendices F–K are PDF documents posted online at the book’s
Companion Website, which is accessible from www.pearsonhighered.com/deitel.

24 C++11 Additional Features 24-1

25 ATM Case Study, Part 1:


Object-Oriented Design with the UML 25-1
25.1 Introduction 25-2
25.2 Introduction to Object-Oriented Analysis and Design 25-2
25.3 Examining the ATM Requirements Document 25-3
25.4 Identifying the Classes in the ATM Requirements Document 25-10
25.5 Identifying Class Attributes 25-17
25.6 Identifying Objects’ States and Activities 25-21
25.7 Identifying Class Operations 25-25
25.8 Indicating Collaboration Among Objects 25-32
25.9 Wrap-Up 25-39

26 ATM Case Study, Part 2:


Implementing an Object-Oriented Design 26-1
26.1 Introduction 26-2
Contents xix

26.2 Starting to Program the Classes of the ATM System 26-2


26.3 Incorporating Inheritance into the ATM System 26-8
26.4 ATM Case Study Implementation 26-15
26.4.1 Class ATM 26-16
26.4.2 Class Screen 26-23
26.4.3 Class Keypad 26-25
26.4.4 Class CashDispenser 26-26
26.4.5 Class DepositSlot 26-28
26.4.6 Class Account 26-29
26.4.7 Class BankDatabase 26-31
26.4.8 Class Transaction 26-35
26.4.9 Class BalanceInquiry 26-37
26.4.10 Class Withdrawal 26-39
26.4.11 Class Deposit 26-44
26.4.12 Test Program ATMCaseStudy.cpp 26-47
26.5 Wrap-Up 26-47

F C Legacy Code Topics F-1


F.1 Introduction F-2
F.2 Redirecting Input/Output on UNIX/Linux/Mac OS X
and Windows Systems F-2
F.3 Variable-Length Argument Lists F-3
F.4 Using Command-Line Arguments F-5
F.5 Notes on Compiling Multiple-Source-File Programs F-7
F.6 Program Termination with exit and atexit F-9
F.7 Type Qualifier volatile F-10
F.8 Suffixes for Integer and Floating-Point Constants F-10
F.9 Signal Handling F-11
F.10 Dynamic Memory Allocation with calloc and realloc F-13
F.11 Unconditional Branch: goto F-14
F.12 Unions F-15
F.13 Linkage Specifications F-18
F.14 Wrap-Up F-19

G UML 2: Additional Diagram Types G-1


G.1 Introduction G-1
G.2 Additional Diagram Types G-2

H Using the Visual Studio Debugger H-1


xx Contents

H.1 Introduction H-2


H.2 Breakpoints and the Continue Command H-2
H.3 Locals and Watch Windows H-8
H.4 Controlling Execution Using the Step Into, Step Over, Step Out
and Continue Commands H-11
H.5 Autos Window H-13
H.6 Wrap-Up H-14

I Using the GNU C++ Debugger I-1


I.1 Introduction I-2
I.2 Breakpoints and the run, stop, continue and print Commands I-2
I.3 print and set Commands I-8
I.4 Controlling Execution Using the step, finish and
next Commands I-10
I.5 watch Command I-13
I.6 Wrap-Up I-15

J Using the Xcode Debugger J-1

K Test Driving a C++ Program on Mac OS X K-1


[Note: The test drives for Windows and Linux are in Chapter 1.]
Preface
“The chief merit of language is clearness …”
—Galen

Welcome to the C++ computer programming language and C++ How to Program, Ninth
Edition. This book presents leading-edge computing technologies. It’s appropriate for in-
troductory course sequences based on the curriculum recommendations of two key pro-
fessional organizations—the ACM and the IEEE. If you haven’t already done so, please
read the back cover and inside back cover—these capture the essence of the book concise-
ly. In this Preface we provide more detail for students, instructors and professionals.
At the heart of the book is the Deitel signature live-code approach—we present con-
cepts in the context of complete working programs followed by sample executions, rather
than in code snippets. Read the online Before You Begin section (www.deitel.com/
books/cpphtp9/cpphtp9_BYB.pdf) to learn how to set up your Linux-based, Windows-
based or Apple OS X-based computer to run the hundreds of code examples. All the source
code is available at www.deitel.com/books/cpphtp9 and www.pearsonhighered.com/
deitel. Use the source code we provide to run each program as you study it.
We believe that this book and its support materials will give you an informative, chal-
lenging and entertaining introduction to C++. As you read the book, if you have questions,
we’re easy to reach at [email protected]—we’ll respond promptly. For book updates,
visit www.deitel.com/books/cpphtp9, join our social media communities on Facebook
(www.deitel.com/DeitelFan), Twitter (@deitel), Google+ (gplus.to/deitel) and
LinkedIn (bit.ly/DeitelLinkedIn), and subscribe to the Deitel ® Buzz Online newsletter
(www.deitel.com/newsletter/subscribe.html).

C++11 Standard
The new C++11 standard, published in 2011, motivated us to write C++ How to Program,
9/e. Throughout the book, each new C++11 feature is marked with the “11” icon you see
here in the margin. These are some of the key C++11 features of this new edition:
• Conforms to the new C++11 standard. Extensive coverage of the new C++11 fea-
tures (Fig. 1).
• Code thoroughly tested on three popular industrial-strength C++11 compilers.
We tested the code examples on GNU™ C++ 4.7, Microsoft® Visual C++®
2012 and Apple® LLVM in Xcode® 4.5.
• Smart pointers. Smart pointers help you avoid dynamic memory management er-
rors by providing additional functionality beyond that of built-in pointers. We dis-
cuss unique_ptr in Chapter 17, and shared_ptr and weak_ptr in Chapter 24.
xxii Preface

C++11 features in C++ How to Program, 9/e

all_of algorithm Inheriting base-class constructors Non-deterministic random


any_of algorithm insert container member func- number generation
array container tions return iterators none_of algorithm
auto for type inference is_heap algorithm Numeric conversion
begin/end functions is_heap_until algorithm functions
cbegin/cend container member Keywords new in C++11 nullptr
functions Lambda expressions override keyword
Compiler fix for >> in template List initialization of key–value Range-based for statement
types pairs Regular expressions
copy_if algorithm List initialization of pair objects Rvalue references
copy_n algorithm List initialization of return values Scoped enums
crbegin/crend container mem- List initializing a dynamically shared_ptr smart pointer
ber functions allocated array shrink_to_fit vector/deque
decltype List initializing a vector member function
Default type arguments in func- List initializers in constructor Specifying the type of an
tion templates calls enum's constants
defaulted member functions long long int type static_assert objects for
Delegating constructors min and max algorithms with file names
deleted member functions initializer_list parameters string objects for file names
explicit conversion operators minmax algorithm swap non-member function
final classes minmax_element algorithm Trailing return types for
final member functions move algorithm functions
find_if_not algorithm Move assignment operators tuple variadic template
forward_list container move_backward algorithm unique_ptr smart pointer
Immutable keys in associative Move constructors Unsigned long long int
containers noexcept weak_ptr smart pointer
In-class initializers

Fig. 1 | A sampling of C++11 features in C++ How to Program, 9/e.

• Earlier coverage of Standard Library containers, iterators and algorithms, en-


hanced with C++11 capabilities. We moved the treatment of Standard Library
containers, iterators and algorithms from Chapter 22 in the previous edition to
Chapters 15 and 16 and enhanced it with additional C++11 features. The vast
majority of your data structure needs can be fulfilled by reusing these Standard
Library capabilities. We’ll show you how to build your own custom data struc-
tures in Chapter 19.
• Online Chapter 24, C++11: Additional Topics. In this chapter, we present addi-
tional C++11 topics. The new C++11 standard has been available since 2011, but
not all C++ compilers have fully implemented the features. If all three of our key
compilers already implemented a particular C++11 feature at the time we wrote
this book, we generally integrated a discussion of that feature into the text with a
live-code example. If any of these compilers had not implemented that feature, we
included a bold italic heading followed by a brief discussion of the feature. Many
of those discussions are expanded in online Chapter 24 as the features are imple-
Object-Oriented Programming xxiii

mented. This chapter includes discussions of regular expressions, shared_ptr


and weak_ptr smart pointers, move semantics and more.
• Random Number generation, simulation and game playing. To help make pro-
grams more secure, we’ve added a treatment of C++11’s new non-deterministic
random-number generation capabilities.

Object-Oriented Programming
• Early-objects approach. The book introduces the basic concepts and terminology
of object technology in Chapter 1. You’ll develop your first customized classes
and objects in Chapter 3. Presenting objects and classes early gets you “thinking
about objects” immediately and mastering these concepts more thoroughly.1
• C++ Standard Library string. C++ offers two types of strings—string class ob-
jects (which we begin using in Chapter 3) and C strings. We’ve replaced most oc-
currences of C strings with instances of C++ class string to make programs more
robust and eliminate many of the security problems of C strings. We continue to
discuss C strings later in the book to prepare you for working with the legacy code
that you’ll encounter in industry. In new development, you should favor string
objects.
• C++ Standard Library array. Our primary treatment of arrays now uses the
Standard Library’s array class template instead of built-in, C-style, pointer-based
arrays. We still cover built-in arrays because they remain useful in C++ and so
that you’ll be able to read legacy code. C++ offers three types of arrays—arrays
and vectors (which we start using in Chapter 7) and C-style, pointer-based ar-
rays which we discuss in Chapter 8. As appropriate, we use class template array
instead of C arrays throughout the book. In new development, you should favor
class template array objects.
• Crafting valuable classes. A key goal of this book is to prepare you to build valu-
able classes. In the Chapter 10 case study, you’ll build your own custom Array
class, then in the Chapter 18 exercises you’ll convert it to a class template. You’ll
truly appreciate the class concept. Chapter 10 begins with a test-drive of class
template string so you can see an elegant use of operator overloading before you
implement your own customized class with overloaded operators.
• Case studies in object-oriented programming. We provide case studies that span
multiple sections and chapters and cover the software development lifecycle.
These include the GradeBook class in Chapters 3–7, the Time class in Chapter 9 and
the Employee class in Chapters 11–12. Chapter 12 contains a detailed diagram
and explanation of how C++ can implement polymorphism, virtual functions
and dynamic binding “under the hood.”
• Optional case study: Using the UML to develop an object-oriented design and C++
implementation of an ATM. The UML™ (Unified Modeling Language™) is the

1. For courses that require a late-objects approach, consider C++ How to Program, Late Objects Version,
which begins with six chapters on programming fundamentals (including two on control statements)
and continues with seven chapters that gradually introduce object-oriented programming concepts.
Other documents randomly have
different content
other, from that time called also Nazarenes, admitted with the
orthodox church the conception by the Holy Ghost. 48 But besides this
distinction there existed yet another. The most ancient ecclesiastic
writers, Justin Martyr and Irenæus for example, are acquainted with
those Ebionites only, who regarded Jesus as a naturally born man
first endowed with divine powers at his baptism. 49 In Epiphanius and
the Clementine Homilies, on the other hand, we meet with Ebionites
who had imbibed an element of speculative Gnosticism. This
tendency, which according to Epiphanius is to be dated from one
Elxai, has been ascribed to Essenic influence, 50 and traces of the
same have been discovered in the heresies referred to in the Epistle
to the Colossians; whereas the first class of Ebionites evidently
proceeded from common Judaism. Which form of opinion was the
earlier and which the later developed is not so easily determined;
with reference to the last detailed difference, it might seem, since
the speculative Ebionites are mentioned first by the Clementines and
Epiphanius, whilst Ebionites holding a simpler view are spoken of by
Justin and by Irenæus, that the latter were the earlier; nevertheless
as Tertullian already notices in his time the Gnosticising tendency of
the opinions of the Ebionites respecting Christ 51, and as the germ of
such views existed among the Essenes in the time of Jesus, the
more probable assumption is, that both opinions arose side by side
about the same period. 52 As little can it be proved with regard to the
other difference, that the views concerning Christ held by the
Nazarenes became first, at a later period, lowered to those of the
Ebionites 53; since the notices, partly confused and partly of late
date, of the ecclesiastical writers, may be naturally explained as
arising out of what may be called an optical delusion of the church,
which,—whilst she in fact made continual advances in the
glorification of Christ, but a part of the Jewish Christians remained
stationary,—made it appear to her as if she herself remained
stationary, whilst the others fell back into heresy.

By thus distinguishing the simple and the speculative Ebionites, so


much is gained, that the failure of the genealogies among the latter
class, mentioned by Epiphanius, does not prove them to have been
also wanting among the [136]former. And the less if we should be
able to make it appear probable, that the grounds of their aversion
to the genealogical table, and the grounds of distinction between
them and the other class of Ebionites, were identical. One of these
grounds was evidently the unfavourable opinion, which the Ebionites
of Epiphanius and of the Clementine Homilies had of David, from
whom the genealogy traces the descent of Jesus. It is well known
that they distinguished in the Old Testament a twofold prophecy,
male and female, pure and impure, of which the former only
promised things heavenly and true, the latter things earthly and
delusive; that proceeding from Adam and Abel, this from Eve and
Cain; and both constituted an under current through the whole
history of the revelation. 54 It was only the pious men from Adam to
Joshua whom they acknowledged as true prophets: the later
prophets and men of God, among whom David and Solomon are
named, were not only not recognized, but abhorred. 55 We even find
positive indications that David was an object of their particular
aversion. There were many things which created in them a
detestation of David (and Solomon). David was a bloody warrior; but
to shed blood was, according to the doctrines of these Ebionites, one
of the greatest of sins; David was known to have committed
adultery, (Solomon to have been a voluptuary); and adultery was
even more detested by this sect than murder. David was a performer
on stringed instruments; this art, the invention of the Canaanites
(Gen. iv. 21 ), was held by these Ebionites to be a sign of false
prophecy; finally, the prophecies announced by David and those
connected with him, (and Solomon,) had reference to the kingdoms
of this world, of which the Gnosticising Ebionites desired to know
nothing. 56 Now the Ebionites who had sprung from common Judaism
could not have shared this ground of aversion to the genealogies;
since to the orthodox Jew David was an object of the highest
veneration.

Concerning a second point the notices are not so lucid and


accordant as they should be; namely, whether it was a further
development of the general Ebionitish doctrine concerning the
person of the Christ, which led these Ebionites to reject the
genealogies. According to Epiphanius, they fully recognized the
Gnostic distinction between Jesus the son of Joseph and Mary, and
the Christ who descended upon him 57; and consequently might have
been withheld from referring the genealogy to Jesus only perhaps by
their abhorrence of David. On the other hand, from the whole tenor
of the Clementines, and from one passage in particular, 58 it has
recently been inferred, and not without apparent reason, that the
author of these writings had himself abandoned the view of a
natural conception, and even birth of Jesus 59; whereby it is yet more
manifest that the ground of the rejection of the genealogies by this
sect was peculiar to it, and not common to the other Ebionites.

Moreover positive indications, that the Ebionites who proceeded


from Judaism possessed the genealogies, do not entirely fail. Whilst
the Ebionites [137]of Epiphanius and of the Clementines called Jesus
only Son of God, but rejected the appellation Son of David, as
belonging to the common opinion of the Jews 60; other Ebionites
were censured by the Fathers for recognizing Jesus only as the Son
of David, to whom he is traced in the genealogies, and not likewise
as the Son of God. 61 Further, Epiphanius relates of the earliest
Judaising Gnostics, Cerinthus and Carpocrates, that they used a
Gospel the same in other respects indeed as the Ebionites, but that
they adduced the genealogies, which they therefore read in the
same, in attestation of the human conception of Jesus by Joseph. 62
Also the ἀπομνημονεύματα cited by Justin, and which originated
upon Judæo-christian ground, appear to have contained a genealogy
similar to that in our Matthew; since Justin as well as Matthew
speaks, in relation to Jesus, of a γένος τοῦ Δαβὶδ καὶ Ἀβραὰμ, of a
σπέρμα ἐξ Ἰακὼβ, διὰ Ἰούδα, καὶ Φαρὲς καὶ Ἰεσσαὶ καὶ Δαβὶδ
κατερχόμενον 63; only that at the time, and in the circle of Justin, the
opinion of a supernatural conception of Jesus had already suggested
the reference of the genealogy to Mary, instead of to Joseph.

Hence it appears that we have in the genealogies a memorial,


agreeing with indications from other sources, of the fact that in the
very earliest Christian age, in Palestine, a body of Christians,
numerous enough to establish upon distinct fundamental opinions
two different Messianic tables of descent, considered Jesus to have
been a naturally conceived human being. And no proof is furnished
to us in the apostolic writings, that the Apostles would have declared
this doctrine to be unchristian; it appeared so first from the point of
view adopted by the authors of the histories of the birth in the first
and third Gospels: notwithstanding which, however, it is treated with
surprising lenity by the Fathers of the church.

[Contents]

§ 28.
NATURAL EXPLANATION OF THE HISTORY OF THE
CONCEPTION.
If, as appears from the foregoing statements, so many weighty
difficulties, philosophical as well as exegetical, beset the
supranaturalistic explanation, it is well worth while to examine
whether it be not possible to give an interpretation of the gospel
history which shall obviate these objections. Recourse has been had
to the natural explanation, and the two narratives singly and
conjointly have been successively subjected to the rationalistic mode
of interpretation.

In the first place, the account in Matthew seemed susceptible of


such an interpretation. Numerous rabbinical passages were cited to
demonstrate, that it was consonant with Jewish notions to consider
a son of pious parents to be conceived by the divine co-operation,
and that he should be called the son of the Holy Spirit, without its
being ever imagined that paternal participation was thereby
excluded. It was consequently contended, that the section in
[138]Matthew represented merely the intention of the angel to inform
Joseph, not indeed that Mary had become pregnant in the absence
of all human intercourse, but that notwithstanding her pregnancy
she was to be regarded as pure, not as one fallen from virtue. It was
maintained that the exclusion of paternal participation—which is an
embellishment of the original representation—occurs first in Luke in
the words ἄνδρα οὐ γινώσκω (i. 34 ). 64 When however this view
was justly opposed by the remark, that the expression πρὶν ἢ
συνελθεῖν αὐτοὺς in Matthew (i. 18 ) decidedly excludes the
participation of the only individual in question, namely Joseph; it was
then thought possible to prove that even in Luke the paternal
exclusion was not so positive: but truly this could be done only by an
unexegetical subversion of the clear sense of the words, or else by
uncritically throwing suspicion on a part of a well-connected
narrative. The first expedient is to interpret Mary’s inquiry of the
angel i. 34 , thus: Can I who am already betrothed and married
give birth to the Messiah, for as the mother of the Messiah I must
have no husband? whereupon the angel replies, that God, through
his power, could make something distinguished even of the child
conceived of her and Joseph. 65 The other proceeding is no less
arbitrary. Mary’s inquiry of the angel is explained as an unnatural
interruption of his communication, which being abstracted, the
passage is found to contain no decided intimation of the
supernatural conception. 66

If consequently, the difficulty of the natural explanation of the two


accounts be equally great, still, with respect to both it must be alike
attempted or rejected; and for the consistent Rationalist, a Paulus
for example, the latter is the only course. This commentator
considers the participation of Joseph, indeed excluded by Matt. i.
18 , but by no means that of every other man; neither can he find a
supernatural divine intervention in the expression of Luke i. 35 .
The Holy Ghost—πνεῦμα ἅγιον—is not with him objective, an
external influence operating upon Mary, but her own pious
imagination. The power of the Highest—δύναμις ὑψίστου—is not the
immediate divine omnipotence, but every natural power employed in
a manner pleasing to God may be so called. Consequently, according
to Paulus, the meaning of the angelic announcement is simply this:
prior to her union with Joseph, Mary, under the influence of a pure
enthusiasm in sacred things on the one hand, and by an human co-
operation pleasing to God on the other, became the mother of a
child who on account of this holy origin was to be called a son of
God.
Let us examine rather more accurately the view which this
representative of rationalistic interpretation takes of the particulars
of the conception of Jesus. He begins with Elizabeth, the patriotic
and wise daughter of Aaron, as he styles her. She, having conceived
the hope that she might give birth to one of God’s prophets,
naturally desired moreover that he might be the first of prophets,
the forerunner of the Messiah; and that the latter also might
speedily be born. Now there was among her own kinsfolk a person
suited in every respect for the mother of the Messiah, Mary, a young
virgin, a descendant of David; nothing more was needful than to
inspire her likewise with such a special hope. Whilst these
intimations prepare us to anticipate a cleverly concerted plan on the
part of Elizabeth in reference to her young relative, in the which we
hope to become initiated; Paulus here suddenly lets [139]fall the
curtain, and remarks, that the exact manner in which Mary was
convinced that she should become the mother of the Messiah must
be left historically undetermined; thus much only is certain, that
Mary remained pure, for she could not with a clear conscience have
stationed herself, as she afterwards did, under the Cross of her Son,
had she felt that a reproach rested on her concerning the origin of
the hopes she had entertained of him. The following is the only hint
subsequently given of the particular view held by Paulus. It is
probable, he thinks, that the angelic messenger visited Mary in the
evening or even at night; indeed according to the correct reading of
Luke i. 28 , which has not the word angel, καὶ εἰσελθὼν πρὸς αὐτὴν
εἰπε, without ὁ ἄγγελος, the evangelist here speaks only of some one
who had come in. (As if in this case, the participle εἰσελθὼν must
not necessarily be accompanied by τὶς; or, in the absence of the
pronoun be referred to the subject, the angel Gabriel—ὁ ἄγγελος
Γαβριὴλ, v. 26 !) Paulus adds: that this visitant was the angel
Gabriel was the subsequent suggestion of Mary’s own mind, after
she had heard of the vision of Zacharias.

Gabler, in a review of Paulus’s Commentary 67 has fully exposed, with


commensurate plainness of speech, the transaction which lies
concealed under this explanation. It is impossible, says he, to
imagine any other interpretation of Paulus’s view than that some one
passed himself off for the angel Gabriel, and as the pretended
Messenger of God remained with Mary in order that she might
become the mother of the Messiah. What! asks Gabler, is Mary, at
the very time she is betrothed, to become pregnant by another, and
is this to be called an innocent holy action, pleasing to God and
irreproachable? Mary is here pourtrayed as a pious visionary, and the
pretended messenger of heaven as a deceiver, or he too is a gross
fanatic. The reviewer most justly considers such an assertion as
revolting, if contemplated from the christian point of view; if from
the scientific, as at variance both with the principles of interpretation
and of criticism.

The author of the Natural History of the Great Prophet of Nazareth


is, in this instance, to be considered as the most worthy interpreter
of Paulus; for though the former could not, in this part of his work,
have made use of Paulus’s Commentary, yet, in exactly the same
spirit, he unreservedly avows what the latter carefully veils. He
brings into comparison a story in Josephus, 68 according to which, in
the very time of Jesus, a Roman knight won the chaste wife of a
Roman noble to his wishes, by causing her to be invited by a priest
of Isis into the temple of the goddess, under the pretext that the
god Anubis desired to embrace her. In innocence and faith, the
woman resigned herself, and would perhaps afterwards have
believed she had given birth to the child of a god, had not the
intriguer, with bitter scorn, soon after discovered to her the true
state of the case. It is the opinion of the author that Mary, the
betrothed bride of the aged Joseph, was in like manner deceived by
some amorous and fanatic young man (in the sequel to the history
he represents him to be Joseph of Arimathea), and that she on her
part, in perfect innocence, continued to deceive others. 69 It is
evident that this interpretation does not differ from the ancient
Jewish blasphemy, which we find in Celsus and in the Talmud; that
Jesus falsely represented himself as born of a pure virgin, whereas,
in fact, he was the offspring of the adultery of Mary with a certain
Panthera. 70 [140]

This whole view, of which the culminating point is in the calumny of


the Jews, cannot be better judged than in the words of Origen. If,
says this author, they wished to substitute something else in the
place of the history of the supernatural conception of Jesus, they
should at any rate have made it happen in a more probable manner;
they ought not, as it were against their will, to admit that Mary knew
not Joseph, but they might have denied this feature, and yet have
allowed Jesus to have been born of an ordinary human marriage;
whereas the forced and extravagant character of their hypothesis
betrays its falsehood. 71 Is not this as much as to say, that if once
some particular features of a marvellous narrative are doubted, it is
inconsequent to allow others to remain unquestioned? each part of
such an account ought to be subjected to critical examination. The
correct view of the narrative before us is to be found, that is
indirectly, in Origen. For when at one time he places together, as of
the same kind, the miraculous conception of Jesus and the story of
Plato’s conception by Apollo (though here, indeed, the meaning is
that only ill-disposed persons could doubt such things 72), and when
at another time he says of the story concerning Plato, that it belongs
to those mythi by which it was sought to exhibit the distinguished
wisdom and power of great men (but here he does not include the
narrative of Jesus’s conception), he in fact states the two premises,
namely, the similarity of the two narratives and the mythical
character of the one 73; from which the inference of the merely
mythical worth of the narrative of the conception of Jesus follows; a
conclusion which can never indeed have occurred to his own mind.

[Contents]

§ 29.

HISTORY OF THE CONCEPTION OF JESUS VIEWED


AS A MYTHUS.

If, says Gabler in his review of the Commentary of Paulus, we must


relinquish the supernatural origin of Jesus, in order to escape the
ridicule of our contemporaries, and if, on the other hand, the natural
explanation leads to conclusions not only extravagant, but revolting;
the adoption of the mythus, by which all these difficulties are
obviated, is to be preferred. In the world of mythology many great
men had extraordinary births, and were sons of the gods. Jesus
himself spoke of his heavenly origin, and called God his father;
besides, his title as Messiah was—Son of God. From Matthew i. 22 ,
it is further evident that the passage of Isaiah, vii. 14 , was referred
to Jesus by the early Christian Church. In conformity with this
passage the belief prevailed that Jesus, as the Messiah, should be
born of a virgin by means of divine agency; it was therefore taken
for granted that what was to be actually did occur; and thus
originated a philosophical (dogmatical) mythus concerning the birth
of Jesus. But according to historical truth, Jesus was the offspring of
an ordinary marriage, between Joseph and Mary; an explanation
which, it has been justly remarked, maintains at once the dignity of
Jesus and the respect due to his mother. 74 [141]

The proneness of the ancient world to represent the great men and
benefactors of their race as the sons of the gods, has therefore been
referred to, in order to explain the origin of such a mythus. Our
theologians have accumulated examples from the Greco-Roman
mythology and history. They have cited Hercules, and the Dioscuri;
Romulus, and Alexander; but above all Pythagoras, 75 and Plato. Of
the latter philosopher Jerome speaks in a manner quite applicable to
Jesus: sapientiæ principem non aliter arbitrantur, nisi de partu
virginis editum. 76

From these examples it might have been inferred that the narratives
of the supernatural conception had possibly originated in a similar
tendency, and had no foundation in history. Here however the
orthodox and the rationalists are unanimous in denying, though
indeed upon different grounds, the validity of the analogy. Origen,
from a perception of the identical character of the two classes of
narratives, is not far from regarding the heathen legends of the sons
of the gods as true supernatural histories. Paulus on his side is more
decided, and is so logical as to explain both classes of narratives in
the same manner, as natural, but still as true histories. At least he
says of the narrative concerning Plato: it cannot be affirmed that the
groundwork of the history was a subsequent creation; it is far more
probable that Perictione believed herself to be pregnant by one of
her gods. The fact that her son became a Plato might indeed have
served to confirm that belief, but not to have originated it. Tholuck
invites attention to the important distinction that the mythi
concerning Romulus and others were formed many centuries after
the lifetime of these men: the mythi concerning Jesus, on the
contrary, must have existed shortly after his death. 77 He cleverly fails
to remember the narrative of Plato’s birth, since he is well aware
that precisely in that particular, it is a dangerous point. Osiander
however approaches the subject with much pathos, and affirms that
Plato’s apotheosis as son of Apollo did not exist till several centuries
after him 78; whereas in fact Plato’s sister’s son speaks of it as a
prevailing legend in Athens. 79 Olshausen, with whom Neander
coincides, refuses to draw any detrimental inference from this
analogy of the mythical sons of the gods; remarking that though
these narratives are unhistorical, they evince a general anticipation
and desire of such a fact, and therefore guarantee its reality, at least
in one historical manifestation. Certainly, a general anticipation and
representation must have truth for its basis; but the truth does not
consist in any one individual fact, presenting an accurate
correspondence with that notion, but in an idea which realizes itself
in a series of facts, which often bear no resemblance to the general
notion. The widely spread notion of a golden age does not prove the
existence of a golden age: so the notion of divine conceptions does
not prove that some one individual was thus produced. The truth
which is the basis of this notion is something quite different.

A more essential objection 80 to the analogy is, that the


representations of [142]the heathen world prove nothing with respect
to the isolated Jews; and that the idea of sons of the gods,
belonging to polytheism, could not have exerted an influence on the
rigidly monotheistic notion of the Messiah. At all events such an
inference must not be too hastily drawn from the expression “sons
of God,” found likewise among the Jews, which as applied in the Old
Testament to magistrates, (Ps. lxxxii. 6 , or to theocratic kings, 2
Sam. vii. 14 , Ps. ii. 7 ,) indicates only a theocratic, and not a
physical or metaphysical relation. Still less is importance to be
attached to the language of flattery used by a Roman, in Josephus,
who calls beautiful children of the Jewish princes children of God. 81
It was, however, a notion among the Jews, as was remarked in a
former section, that the Holy Spirit co-operated in the conception of
pious individuals; moreover, that God’s choicest instruments were
conceived by divine assistance of parents, who could not have had a
child according to the natural course of things. And if, according to
the believed representation, the extinct capability on both sides was
renewed by divine intervention (Rom. iv. 19 ), it was only one step
further to the belief that in the case of the conception of the most
distinguished of all God’s agents, the Messiah, the total absence of
participation on the one side was compensated by a more complete
superadded capability on the other. The latter is scarcely a degree
more marvellous than the former. And thus must it have appeared to
the author of Luke i. , since he dissipates Mary’s doubts by the
same reply with which Jehovah repelled Sara’s incredulity. 82 Neither
the Jewish reverence for marriage, nor the prevalent representation
of the Messiah as a human being, could prevent the advance to this
climax; to which, on the other hand, the ascetic estimation of
celibacy, and the idea, derived from Daniel, of the Christ as a
superhuman being, contributed. But decided impulse to the
development of the representations embodied in our histories of the
birth, consisted partly in the title, Son of God, at one time usually
given to the Messiah. For it is the nature of such originally figurative
expressions, after a while to come to be interpreted according to
their more precise and literal signification; and it was a daily
occurrence, especially among the later Jews, to attach a sensible
signification to that which originally had merely a spiritual or
figurative meaning. This natural disposition to understand the
Messianic title Son of God more and more literally, was fostered by
the expression in the Psalms (ii. 7 ), interpreted of the Messiah:
Thou art my Son; this day have I begotten thee: words which can
scarcely fail to suggest a physical relation; it was also nurtured by
the prophecy of Isaiah respecting the virgin who should be with
child, which it appears was applied to the Messiah; as were so many
other prophecies of which the immediate signification had become
obscure. This application may be seen in the Greek word chosen by
the Septuagint, παρθένος, a pure unspotted virgin, whereas by
Aquila and other Greek translators the word νεᾶνις is used. 83 Thus
did the notions of a son of God and a son of a virgin complete one
another, till at last the divine agency was substituted for human
paternal participation. Wetstein indeed affirms that no Jew ever
applied the prophecy of Isaiah to the Messiah; and it was with
extreme labour that Schoettgen collected traces of the notion that
the Messiah should be the son of a virgin from the Rabbinical
writings. This however, considering the paucity of records of the
Messianic ideas of that age, 84 proves nothing in opposition to the
presumption that a [143]notion then prevailed, of which we have the
groundwork in the Old Testament, and an inference hardly to be
mistaken in the New.

One objection yet remains, which I can no longer designate as


peculiar to Olshausen, since other theologians have shown
themselves solicitous of sharing the fame. The objection is, that the
mythical interpretation of the gospel narrative is especially
dangerous, it being only too well fitted to engender, obscurely
indeed, profane and blasphemous notions concerning the origin of
Jesus; since it cannot fail to favour an opinion destructive of the
belief in a Redeemer, namely, that Jesus came into being through
unholy means; since, in fact, at the time of her pregnancy Mary was
not married. 85 In Olshausen’s first edition of his work, he adds that
he willingly allows that these interpreters know not what they do: it
is therefore but just to give him the advantage of the same
concession, since he certainly appears not to know what mythical
interpretation means. How otherwise would he say, that the mythical
interpretation is fitted only to favour a blasphemous opinion;
therefore that all who understand the narrative mythically, are
disposed to commit the absurdity with which Origen reproaches the
Jewish calumniators; the retaining one solitary incident, namely, that
Mary was not married, whilst the remainder of the narrative is held
to be unhistorical; a particular incident which evidently serves only
as a support to the other, that Jesus was conceived without human
paternal participation, and with it, therefore, stands or falls. No one
among the interpreters who, in this narrative, recognise a mythus, in
the full signification of that term, has been thus blind and
inconsequent; all have supposed a legitimate marriage between
Joseph and Mary; and Olshausen merely paints the mythical mode of
interpretation in caricature, in order the more easily to set it aside;
for he confesses that in relation to this portion of the Gospel in
particular, it has much that is dazzling.

[Contents]

§ 30.
RELATION OF JOSEPH TO MARY—BROTHERS OF
JESUS.
Our Gospels, in the true spirit of the ancient legend, find it
unbecoming to allow the mother of Jesus, so long as she bore the
heavenly germ, to be approached or profaned by an earthly
husband. Consequently Luke (ii. 5 ) represents the connexion
between Joseph and Mary, prior to the birth of Jesus, as a
betrothment merely. And, as it is stated respecting the father of
Plato, after his wife had become pregnant by Apollo: ὅθεν καθαρὰν
γάμου φυλάξαι ἕως τῆς ἀποκυήσεως, 86 so likewise it is remarked of
Joseph in Matthew (i. 25 ): καὶ οὐκ ἐγίνωσκεν αὐτὴν (τὴν γυναῖκα
αὑτοῦ) ἕως οὖ ἔτεκε τὸν υἱὸν αὑτῆς τὸν πρωτότοκον. In each of
these kindred passages the Greek word ἕως (till) must evidently
receive the same interpretation. Now in the first quotation the
meaning is incontestably this:—that till the time of Plato’s birth his
father abstained from intercourse with his wife, but subsequently
assumed his conjugal rights, since we hear of Plato’s brothers. In
reference, therefore, to the parents of Jesus, the ἕως cannot have a
different signification; in each case it indicates precisely the same
limitation. So again the expression πρωτότοκος (firstborn) used in
reference to Jesus in both the Gospels (Matt. i. 25 , Luke ii. 7 )
supposes that Mary had other children, for as Lucian says: εἰ μὲν
πρῶτος, οὐ μόνος· εἰ δὲ μόνος, οὐ πρῶτος. 87 Even in the same
Gospels (Matt. xiii. 55 , [144]Luke viii. 19 ) mention is made of
ἀδελφοῖς Ἰησοῦ (the brothers of Jesus). In the words of Fritzsche:
Lubentissime post Jesu natales Mariam concessit Matthæus (Luke
does the same) uxorem Josepho, in hoc uno occupatus, ne quis ante
Jesu primordia mutuâ venere usos suspicaretur. But this did not
continue to satisfy the orthodox; as the veneration for Mary rose
even higher, she who had once become fruitful by divine agency was
not subsequently to be profaned by the common relations of life. 88
The opinion that Mary after the birth of Jesus became the wife of
Joseph, was early ranked among the heresies, 89 and the orthodox
Fathers sought every means to escape from it and to combat it.
They contended that according to the exegetical interpretation of
ἕως οὗ, it sometimes affirmed or denied a thing, not merely up to a
certain limit, but beyond that limitation and for ever; and that the
words of Matthew οὐκ ἐγίνωσκεν αὐτὴν ἕως οὗ ἔτεκε κ.τ.λ. excluded
a matrimonial connexion between Joseph and Mary for all time. 90 In
like manner it was asserted of the term πρωτότοκος, that it did not
necessarily include the subsequent birth of other children, but that it
merely excluded any previous birth. 91 But in order to banish the
thought of a matrimonial connexion between Mary and Joseph, not
only grammatically but physiologically, they represented Joseph as a
very old man, under whom Mary was placed for control and
protection only; and the brothers of Jesus mentioned in the New
Testament they regarded as the children of Joseph by a former
marriage. 92 But this was not all; soon it was insisted not only that
Mary never became the wife of Joseph, but that in giving birth to
Jesus she did not lose her virginity. 93 But even the conservation of
Mary’s virginity did not long continue to satisfy: perpetual virginity
was likewise required on the part of Joseph. It was not enough that
he had no connexion with Mary; it was also necessary that his entire
life should be one of celibacy. Accordingly, though Epiphanius allows
that Joseph had sons by a former marriage, Jerome rejects the
supposition as an impious and audacious invention; and from that
time the brothers of Jesus were degraded to the rank of cousins. 94

Some modern theologians agree with the Fathers of the Church in


maintaining that no matrimonial connexion subsisted at any time
between Joseph and Mary, and believe themselves able to explain
the gospel expressions which appear to assert the contrary. In
reference to the term firstborn, Olshausen contends that it signifies
an only son: no less than the eldest of several. Paulus allows that
here he is right, and Clemen 95 and Fritzsche seek in vain to
demonstrate the impossibility of this signification. For when it is said
in Ex. xiii. 2 , ‫‏ַקֶּד ׁש־ִלי ָכל־ְּבכֹול ֶּפֶטר ָּכל־ֶר ֶחם‬‎(πρωτότοκον
πρωτογενὲς LXX.) it was not merely a firstborn followed by others
subsequently born, who was sanctified to Jehovah, but the fruit of
the body of that mother of whom no [145]other child had previously
been born. Therefore the term πρωτότοκος must of necessity bear
also this signification. Truly however we must confess with Winer 96
and others, on the other side, that if a narrator who was acquainted
with the whole sequel of the history used that expression, we should
be tempted to understand it in its primitive sense; since had the
author intended to exclude other children, he would rather have
employed the word μονογενὴς, or would have connected it with
πρωτότοκος. If this be not quite decisive, the reasoning of Fritzsche
in reference to the ἕως οὗ, κ.τ.λ., is more convincing. He rejects the
citations adduced in support of the interpretation of the Fathers of
the Church, proving that this expression according to its primitive
signification affirms only to a given limit, and beyond that limit
supposes the logical opposite of the affirmation to take place; a
signification which it loses only when the context shows clearly that
the opposite is impossible in the nature of things. 97 For example,
when it is said οὐκ ἐγίνωσκεν αὐτὴν, ἕως οὗ ἀπέθανεν, it is self-
evident that the negation, during the time elapsed till death—cannot
be transformed after death into an affirmation; but when it is said,
as in Matthew, οὐκ ἐ. ἀ. ἕως οὗ ἔτεκεν, the giving birth to the divine
fruit opposes no impossibility to the establishment of the conjugal
relations; on the contrary it renders it possible, i.e. suitable 98 for
them now to take place.

Olshausen, impelled by the same doctrinal motives which influenced


the Fathers, is led in this instance to contradict both the evidence of
grammar and of logic. He thinks that Joseph, without wishing to
impair the sanctity of marriage, must have concluded after the
experiences he had had (?) that his marriage with Mary had another
object than the production of children; besides it was but natural (?)
in the last descendant of the house of David, and of that particular
branch from which the Messiah should come forth, to terminate her
race in this last and eternal offshoot.

A curious ladder may be formed of these different beliefs and


superstitions in relation to the connexion between Mary and Joseph.

1. Contemporaries of Jesus and composers of the genealogies:


Joseph and Mary man and wife—Jesus the offspring of their
marriage.

2. The age and authors of our histories of the birth of Jesus: Mary
and Joseph betrothed only; Joseph having no participation in the
conception of the child, and previous to his birth no conjugal
connexion with Mary.

3. Olshausen and others: subsequent to the birth of Jesus, Joseph,


though then the husband of Mary, relinquishes his matrimonial
rights.

4. Epiphanius, Protevangelium Jacobi and others: Joseph a decrepit


old man, no longer to be thought of as a husband: the children
attributed to him are of a former marriage. More especially it is not
as a bride and wife that he receives Mary; he takes her merely under
his guardianship.

5. Protevang., Chrysostom and others: Mary’s virginity was not only


not destroyed by any subsequent births of children by Joseph, it was
not in the slightest degree impaired by the birth of Jesus.

6. Jerome: not Mary only but Joseph also observed an absolute


virginity, and the pretended brothers of Jesus were not his sons but
merely cousins to Jesus. [146]

The opinion that the ἀδελφοὶ (brothers) and ἀδελφαὶ Ἰησοῦ (sisters
of Jesus) mentioned in the New Testament, were merely half
brothers or indeed cousins, appears in its origin, as shown above,
together with the notion that no matrimonial connexion ever
subsisted between Joseph and Mary, as the mere invention of
superstition, a circumstance highly prejudicial to such an opinion. It
is however no less true that purely exegetical grounds exist, in virtue
of which theologians who were free from prejudice have decided,
that the opinion that Jesus actually had brothers is untenable. 99 Had
we merely the following passages—Matt. xiii. 55 , Mark vi. 3 ,
where the people of Nazareth, astonished at the wisdom of their
countryman, in order to mark his well known origin, immediately
after having spoken of τέκτων (the carpenter) his father, and his
mother Mary, mention by name his ἀδελφοὺς (brothers) James,
Joses, Simon, and Judas, together with his sisters whose names are
not given 100; again Matt. xii. 46 , Luke viii. 19 , when his mother
and his brethren come to Jesus; John ii. 12 , where Jesus journeys
with his mother and his brethren to Capernaum; Acts i. 14 , where
they are mentioned in immediate connexion with his mother—if we
had these passages only, we could not for a moment hesitate to
recognize here real brothers of Jesus at least on the mother’s side,
children of Joseph and Mary; not only on account of the proper
signification of the word ἀδελφὸς, but also in consequence of its
continual conjunction with Mary and Joseph. Even the passages—
John vii. 5 , in which it is remarked that his brethren did not believe
on Jesus, and Mark iii. 21 , compared with 31 , where, according to
the most probable explanation, the brothers of Jesus with his mother
went out to lay hold of him as one beside himself—furnish no
adequate grounds for relinquishing the proper signification of
ἀδελφὸς. Many theologians have interpreted ἀδελφοὺς Ἰησοῦ in the
last cited passage half brothers, sons of Joseph by a former
marriage, alleging that the real brothers of Jesus must have believed
on him, but this is a mere assumption. The difficulty seems greater
when we read in John xix. 26 f. that Jesus, on the cross, enjoined
John to be a son to his mother; an injunction it is not easy to regard
as suitable under the supposition that Mary had other children,
except indeed these were half-brothers and unfriendly to Jesus.
Nevertheless we can imagine the existence both of external
circumstances and of individual feelings which might have influenced
Jesus to confide his mother to John rather than to his brothers. That
these brothers appeared in company with his apostles after the
ascension (Acts i. 14 ) is no proof that they must have believed on
Jesus at the time of his death.

The real perplexity in the matter, however, originates in this: that


besides the James and Joses spoken of as the brothers of Jesus, two
men of the same name are mentioned as the sons of another Mary
(Mark xv. 40 , 47 , xvi. 1 , Matt. xxvii. 56 ), without doubt that
Mary who is designated, John xix. 25 , as the sister of the mother of
Jesus, and the wife of Cleophas; so that we have a James and a
Joses not only among the children of Mary the mother of Jesus, but
again among her sister’s children. We meet with several others
among those immediately connected with Jesus, whose names are
identical. In the lists of the apostles (Matt. x. 2 ff. , Luke vi. 14 ff. )
we have two more of the name of James: that is four, the brother
and cousin of Jesus included; two more of the name of Judas: that is
three, the brother of Jesus included; two of the name of Simon, also
making three with the brother of Jesus of the [147]same name. The
question naturally arises, whether the same individual is not here
taken as distinct persons? The suspicion is almost unavoidable in
reference to James. As James the son of Alpheus is, in the list of the
apostles, introduced after the son of Zebedee, as the second,
perhaps the younger; and as James the cousin of Jesus is called ὁ
μικρὸς (“the less”) Mark xv. 40 ; and since by comparing John xix.
25 , we find that the latter is called the son of Cleophas, it is
possible that the name Κλωπᾶς (Cleophas) given to the husband of
Mary’s sister, and the name Ἀλφαῖος (Alpheus) given to the father of
the apostle, may be only different forms of the Hebrew ‫‏חלפי‬‎. Thus
would the second James enumerated among the apostles and the
cousin of Jesus of that name be identical, and there would remain
besides him only the son of Zebedee and the brother of Jesus. Now
in the Acts (xv. 13 ) a James appears who takes a prominent part in
the so-called apostolic council, and as, according to Acts xii. 2 , the
son of Zebedee had previously been put to death, and as in the
foregoing portion of the book of the Acts no mention is made of any
other James besides the son of Alpheus (i. 13 ), so this James, of
whom (Acts xv. 13 ) no more precise description is given, can be no
other than the son of Alpheus. But Paul speaks of a James (Gal. i.
19 ) the Lord’s brother, whom he saw at Jerusalem, and it is
doubtless he of whom he speaks in connexion with Cephas and John
as the στύλοι (pillars) of the church—for this is precisely in character
with the (Apostle) James as he appeared at the apostolic council—so
that this James may be considered as identical with the Lord’s
brother, and the rather as the expression ἔτερον δὲ τῶν ἀποστόλων
οὐκ εἶδον, εἰ μὴ Ἰάκωβον τὸν ἀδελφὸν τοῦ Κυρίου (but other of the
apostles saw I none, save James the Lord’s brother. Gal. i. 19 ),
makes it appear as if the Lord’s brother were reckoned among the
apostles; with which also the ancient tradition which represents
James the Just, a brother of Jesus, as the first head of the church at
Jerusalem, agrees. 101 But admitting the James of the Acts to be
identical with the distinguished apostle of that name, then is he the
son of Alpheus, and not the son of Joseph; consequently if he be at
the same time ἀδελφὸς τοῦ Κυρίου, then ἀδελφὸς cannot signify a
brother. Now if Alpheus and Cleophas are admitted to be the same
individual, the husband of the sister of Mary the mother of Jesus, it
is obvious that ἀδελφὸς, used to denote the relationship of his son
to Jesus, must be taken in the signification, cousin. If, after this
manner, James the Apostle the son of Alpheus be identified with the
cousin, and the cousin be identified with the brother of Jesus of the
same name, it is obvious that Ἰούδας Ἰακώβου in the catalogue of
the Apostles in Luke (Luke vi. 16 , Acts i. 13 ), must be translated
brother of James (son of Alpheus); and this Apostle Jude must be
held as identical with the Jude ἀδελφὸς Ἰησοῦ, that is, with the
cousin of the Lord and son of Mary Cleophas (though the name of
Jude is never mentioned in connexion with this Mary). If the Epistle
of Jude in our canon be authentic, it is confirmatory of the above
deduction, that the author (verse 1 ) designates himself as the
ἀδελφὸς Ἰακώβου (brother of James). Some moreover have
identified the Apostle Simon ὁ ζηλωτὴς or Κανανίτης (Zelotes or the
Canaanite) with the Simon enumerated among the brothers of Jesus
(Mark vi. 3 ), and who according to a tradition of the church
succeeded James as head of the church at Jerusalem 102; so that
Joses alone appears without further designation or appellative.

If, accordingly, those spoken of as ἀδελφοὶ Ἰησοῦ were merely


cousins, and three of these were apostles, it must excite surprise
that not only in the Acts (i. 14 ), after an enumeration of the
apostles, the brothers of Jesus are separately [148]particularized, but
that also (1 Cor. ix. 5 ) they appear to be a class distinct from the
apostles. Perhaps, also, the passage Gal. i. 19 ought to be
understood as indicating that James, the Lord’s brother, was not an
apostle. 103 If, therefore, the ἀδελφοὶ Ἰησοῦ seem thus to be
extruded from the number of the apostles, it is yet more difficult to
regard them merely as the cousins of Jesus, since they appear in so
many places immediately associated with the mother of Jesus, and
in two or three passages only are two men bearing the same names
mentioned in connexion with the other Mary, who accordingly would
be their real mother. The Greek word ἀδελφὸς may indeed signify, in
language which pretends not to precision, as well as the Hebrew ‫‏אה‬‎,
a more distant relative; but as it is repeatedly used to express the
relationship of these persons to Jesus, and is in no instance replaced
by ἀνεψιὸς—a word which is not foreign to the New Testament
language when the relationship of cousin is to be denoted (Col. iv.
10 ), it cannot well be taken in any other than its proper
signification. Further, it need only be pointed out that the highest
degree of uncertainty exists respecting not only the identity of the
names Alpheus and Cleophas, upon which the identity of James the
cousin of Jesus and of the Apostle James the Less rests, but also
regarding the translation of Ἰούδας Ἰακώβου by the brother of
James; and likewise respecting the assumed identity of the author of
the last Catholic Epistle with the Apostle Jude.
Thus the web of this identification gives way at all points, and we
are forced back to the position whence we set out; so that we have
again real brothers of Jesus, also two cousins distinct from these
brothers, though bearing the same names with two of them, besides
some apostles of the same names with both brothers and cousins.
To find two pairs of sons of the same names in a family is, indeed,
not so uncommon as to become a source of objection. It is,
however, remarkable that the same James who in the Epistle to the
Galatians is designated ἀδελφὸς Κυρίου (the Lord’s brother), must
unquestionably, according to the Acts of the Apostles, be regarded
as the son of Alpheus; which he could not be if this expression
signified a brother. So that there is perplexity on every side, which
can be solved only (and then, indeed, but negatively and without
historical result) by admitting the existence of obscurity and error on
this point in the New Testament writers, and even in the very
earliest Christian traditions; error which, in matters of involved
relationships and family names, is far more easily fallen into than
avoided. 104

We have consequently no ground for denying that the mother of


Jesus bore her husband several other children besides Jesus,
younger, and perhaps also older; the latter, because the
representation in the New Testament that Jesus was the first-born
may belong no less to the mythus than the representation of the
Fathers that he was an only son.

[Contents]

§ 31.
VISIT OF MARY TO ELIZABETH.
The angel who announced to Mary her own approaching pregnancy,
at the same time informed her (Luke i. 36 ) of that of her relative
Elizabeth, with whom it was already the sixth month. Hereupon Mary
immediately set out on a journey to her cousin, a visit which was
attended by extraordinary occurrences; for when Elizabeth heard the
salutation of Mary, the babe leaped in her womb for joy; she also
became inspired, and in her exultation poured [149]forth an address
to Mary as the future mother of the Messiah, to which Mary
responded by a hymn of praise (Luke i. 39–56 ).

The rationalistic interpreter believes it to be an easy matter to give a


natural explanation of this narrative of the Gospel of Luke. He is of
opinion 105 that the unknown individual who excited such peculiar
anticipations, in Mary, had at the same time acquainted her with the
similar situation of her cousin Elizabeth. This it was which impelled
Mary the more strongly to confer on the subject with her older
relative. Arrived at her cousin’s dwelling, she first of all made known
what had happened to herself; but upon this the narrator is silent,
not wishing to repeat what he had just before described. And here
the Rationalist not only supposes the address of Elizabeth to have
been preceded by some communication from Mary, but imagines
Mary to have related her history piecemeal, so as to allow Elizabeth
to throw in sentences during the intervals. The excitement of
Elizabeth—such is the continuation of the rationalistic explanation—
communicated itself, according to natural laws, to the child, who, as
is usual with an embryo of six months, made a movement, which
was first regarded by the mother as significant, and as the
consequence of the salutation, after Mary’s farther communications.
Just as natural does it appear to the Rationalist that Mary should
have given utterance to her Messianic expectations, confirmed as
they were by Elizabeth, in a kind of psalmodic recitative, composed
of reminiscences borrowed from various parts of the Old Testament.

But there is much in this explanation which positively contradicts the


text. In the first place, that Elizabeth should have learned the
heavenly message imparted to Mary from Mary herself. There is no
trace in the narrative either of any communication preceding
Elizabeth’s address, or of interruptions occasioned by farther
explanations on the part of Mary. On the contrary, as it is a
supernatural revelation which acquaints Mary with the pregnancy of
Elizabeth, so also it is to a revelation that Elizabeth’s immediate
recognition of Mary, as the chosen mother of the Messiah, is
attributed. 106 As little will the other feature of this narrative—that the
entrance of the mother of the Messiah occasioned a responsive
movement in his mother’s womb on the part of his forerunner—bear
a natural explanation. In modern times, indeed, even orthodox
interpreters have inclined to this explanation, but with the
modification, that Elizabeth in the first place received a revelation, in
which however the child, owing to the mother’s excitement, a matter
to be physiologically explained, likewise took part. 107 But the record
does not represent the thing as if the excitement of the mother were
the determining cause of the movement of the child; on the contrary
(v. 41 ), the emotion of the mother follows the movement of the
child, and Elizabeth’s own account states, that it was the salutation
of Mary (v. 44 ), not indeed from its particular signification, but
merely as the voice of the mother of the Messiah, which produced
the movement of the unborn babe: undeniably assuming something
supernatural. And indeed the supranaturalistic view of this miracle is
not free from objection, even on its own ground; and hence the
anxiety of the above-mentioned modern orthodox interpreters to
evade it. It may be possible to conceive the human mind
immediately acted upon by the divine mind, to which it is related,
but how solve the difficulty of an immediate communication of the
divine mind to an unintelligent embryo? And if we inquire the object
of so strange a miracle, none which is worthy presents itself. Should
[150]it be referred to the necessity that the Baptist should receive the
earliest possible intimation of the work to which he was destined;
still we know not how such an impression could have been made
upon an embryo. Should the purpose be supposed to centre in the
other individuals, in Mary or Elizabeth; they had been the recipients
of far higher revelations, and were consequently already possessed
of an adequate measure of insight and faith.

No fewer difficulties oppose the rationalistic than the


supranaturalistic explanation of the hymn pronounced by Mary. For
though it is not, like the Canticle of Zacharias (v. 67 ) and the
address of Elizabeth (v. 41 ), introduced by the formula ἐπλήσθη
πνεύματος ἁγίου, she was filled with the Holy Ghost, still the
similarity of these utterances is so great, that the omission cannot be
adduced as a proof that the narrator did not intend to represent this,
equally with the other two, as the operation of the πνεῦμα (spirit).
But apart from the intention of the narrator, can it be thought
natural that two friends visiting one another should, even in the
midst of the most extraordinary occurrences, break forth into long
hymns, and that their conversation should entirely lose the character
of dialogue, the natural form on such occasions? By a supernatural
influence alone could the minds of the two friends be attuned to a
state of elevation, so foreign to their every-day life. But if, indeed,
Mary’s hymn is to be understood as the work of the Holy Spirit, it is
surprising that a speech emanating immediately from the divine
source of inspiration should not be more striking for its originality,
but should be so interlarded with reminiscences from the Old
Testament, borrowed from the song of praise spoken by the mother
of Samuel (1 Sam. ii. ) under analogous circumstances. 108
Accordingly we must admit that the compilation of this hymn,
consisting of recollections from the Old Testament, was put together
in a natural way; but allowing its composition to have been perfectly
natural, it cannot be ascribed to the artless Mary, but to him who
poetically wrought out the tradition in circulation respecting the
scene in question.

Since then we find all the principal incidents of this visit


inconceivable according to the supernatural interpretation; also that
they will not bear a natural explanation; we are led to seek a
mythical exposition of this as well as the preceding portions of the
gospel history. This path has already been entered upon by others.
The view of this narrative given by the anonymous E. F. in Henke’s
Magazine 109 is, that it does not pourtray events as they actually did
occur, but as they might have occurred; that much which the sequel
taught of the destiny of their sons was carried back into the
speeches of these women, which were also enriched by other
features gleaned from tradition; that a true fact however lies at the
bottom, namely an actual visit of Mary to Elizabeth, a joyous
conversation, and the expression of gratitude to God; all which
might have happened solely in virtue of the high importance
attached by Orientals to the joys of maternity, even though the two
mothers had been at that time ignorant of the destination of their
children. This author is of opinion that Mary, when pondering over at
a later period the remarkable life of her son, may often have related
the happy meeting with her cousin and [151]their mutual expressions
of thankfulness to God, and that thus the history gained currency.
Horst also, who has a just conception of the fictitious nature of this
section in Luke, and ably refutes the natural mode of explanation,
yet himself slides unawares half-way back into it. He thinks it not
improbable that Mary during her pregnancy, which was in many
respects a painful one, should have visited her older and more
experienced cousin, and that Elizabeth should during this visit have
felt the first movement of her child: an occurrence which as it was
afterwards regarded as ominous, was preserved by the oral
tradition. 110

These are farther examples of the uncritical proceeding which


pretends to disengage the mythical and poetical from the narrative,
by plucking away a few twigs and blossoms of that growth, whilst it
leaves the very root of the mythus undisturbed as purely historical.
In our narrative the principal mythical feature (the remainder forms
only its adjuncts) is precisely that which the above-mentioned
authors, in their pretended mythical explanations, retain as
historical: namely, the visit of Mary to the pregnant Elizabeth. For, as
we have already seen, the main tendency of the first chapter of Luke
is to magnify Jesus by connecting the Baptist with him from the
earliest possible point in a relation of inferiority. Now this object
could not be better attained than by bringing about a meeting, not
in the first instance of the sons, but of the mothers in reference to
their sons, during their pregnancy, at which meeting some
occurrence which should prefigure the future relative positions of
these two men should take place. Now the more apparent the
existence of a dogmatical motive as the origin of this visit, the less
probability is there that it had an historical foundation. With this
principal feature the other details are connected in the following
order:—The visit of the two women must be represented as possible
and probable by the feature of family relationship between Mary and
Elizabeth (v. 36 ), which would also give a greater suitability to 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