100% found this document useful (2 votes)
21 views

Object Oriented Programming with C 2 e Second Edition Sahay - Get instant access to the full ebook with detailed content

The document promotes instant access to various eBooks on object-oriented programming and related topics available for download at ebookgate.com. It includes titles such as 'Object Oriented Programming with C++' by Sourav Sahay and various editions of books on programming in C and Java. The document also provides details about the structure and content of the second edition of Sahay's book, emphasizing its focus on object-oriented programming principles and features of C++.

Uploaded by

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

Object Oriented Programming with C 2 e Second Edition Sahay - Get instant access to the full ebook with detailed content

The document promotes instant access to various eBooks on object-oriented programming and related topics available for download at ebookgate.com. It includes titles such as 'Object Oriented Programming with C++' by Sourav Sahay and various editions of books on programming in C and Java. The document also provides details about the structure and content of the second edition of Sahay's book, emphasizing its focus on object-oriented programming principles and features of C++.

Uploaded by

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

Instant Ebook Access, One Click Away – Begin at ebookgate.

com

Object Oriented Programming with C 2 e Second


Edition Sahay

https://ebookgate.com/product/object-oriented-programming-
with-c-2-e-second-edition-sahay/

OR CLICK BUTTON

DOWLOAD EBOOK

Get Instant Ebook Downloads – Browse at https://ebookgate.com


Click here to visit ebookgate.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Object oriented programming in C 7th print. with


corrections Edition Lafore

https://ebookgate.com/product/object-oriented-programming-in-c-7th-
print-with-corrections-edition-lafore/

ebookgate.com

Object oriented programming with ABAP Objects 1st Edition


James Wood

https://ebookgate.com/product/object-oriented-programming-with-abap-
objects-1st-edition-james-wood/

ebookgate.com

Beginning C 3 0 an introduction to object oriented


programming 1st Edition Jack Purdum

https://ebookgate.com/product/beginning-c-3-0-an-introduction-to-
object-oriented-programming-1st-edition-jack-purdum/

ebookgate.com

Object oriented Analysis And Design Understanding System


Development With UML 2 0 First Edition Mike O'Docherty

https://ebookgate.com/product/object-oriented-analysis-and-design-
understanding-system-development-with-uml-2-0-first-edition-mike-
odocherty/
ebookgate.com
Object Oriented Oracle Wenny Rahayu

https://ebookgate.com/product/object-oriented-oracle-wenny-rahayu/

ebookgate.com

ActionScript 3 0 design patterns object oriented


programming techniques 1st ed Edition William Sanders

https://ebookgate.com/product/actionscript-3-0-design-patterns-object-
oriented-programming-techniques-1st-ed-edition-william-sanders/

ebookgate.com

Programming ArcObjects with VBA a task oriented approach


Chang

https://ebookgate.com/product/programming-arcobjects-with-vba-a-task-
oriented-approach-chang/

ebookgate.com

Programming in Objective C 2. print. with corr., Nachdr.


Edition Kochan

https://ebookgate.com/product/programming-in-objective-c-2-print-with-
corr-nachdr-edition-kochan/

ebookgate.com

The principles of object oriented JavaScript Zakas

https://ebookgate.com/product/the-principles-of-object-oriented-
javascript-zakas/

ebookgate.com
Object Oriented
Programming with
C++
SECOND EDITION

Sourav Sahay
Lead Consultant
Capgemini
Detroit, Michigan

1
3
Oxford University Press is a department of the University of Oxford.
It furthers the University’s objective of excellence in research, scholarship,
and education by publishing worldwide. Oxford is a registered trade mark of
Oxford University Press in the UK and in certain other countries.

Published in India by
Oxford University Press
YMCA Library Building, 1 Jai Singh Road, New Delhi 110001, India

© Oxford University Press 2006, 2012

The moral rights of the author/s have been asserted.

First Edition Published in 2006


Second Edition Published in 2012

All rights reserved. No part of this publication may be reproduced, stored in


a retrieval system, or transmitted, in any form or by any means, without the
prior permission in writing of Oxford University Press, or as expressly permitted
by law, by licence, or under terms agreed with the appropriate reprographics
rights organization. Enquiries concerning reproduction outside the scope of the
above should be sent to the Rights Department, Oxford University Press, at the
address above.

You must not circulate this work in any other form


and you must impose this same condition on any acquirer.

ISBN-13: 978-0-19-806530-2
ISBN-10: 0-19-806530-2

Typeset in Times New Roman


by Recto Graphics, Delhi 110096
Printed in India by Adage Printers (P) Ltd., Noida 201301 U.P.
Preface to the First Edition

C++ made its advent in the early 1980s and enabled programmers to write their programs
the object-oriented way. For this reason, the language quickly gained popularity and became
a programming language of choice. Despite the development of a number of competing
object-oriented languages including Java, C++ has successfully maintained its position of
popularity.
C++ starts where C stops. C++ is a superset of C. All the language features of C language
appear in C++ with little or no modi¿cation. Over and above such features, C++ provides a
number of extra features, which provide the language its object-oriented character.

About the Book

The continued popularity of C++ has led to considerable literature. Innumerable books, journals,
magazines, and articles have been written on C++. So, why another book on C++?
The aim of the book is to thoroughly explain all aspects of the language constructs provided
by C++. While doing full justice to the commonly explained topics of C++, the book does
not neglect the advanced and new concepts of C++ that are not widely taught.
This book is a power-packed instruction guide for Object-Oriented Programming and C++.
The purpose of this book is two-fold:
x To clarify the fundamentals of the Object-Oriented Programming System
x To provide an in-depth treatment of each feature and language construct of C++
This book emphasizes the Object-Oriented Programming System—its bene¿ts and its
superiority over the conventional Procedure-Oriented Programming System.
This book starts directly with C++ since the common features of C and C++ are anyway
covered in books on C language. Each feature of C++ is covered from the practical point of
view. Instead of brief introductions, this book gives an in-depth explanation of the rationale
and proper use of each object-oriented feature of C++.
To help the readers assimilate the large volume of knowledge contained in this book, an
adequate number of example programs, well-designed diagrams, and analogies with the real
world have been given. Some program examples given in this book are abstract in nature to
help readers focus on the concept being discussed.
Preface to the First Edition vii

Acknowledgements
First, I thank my parents for teaching me a number of valuable lessons of life including the
value of hardwork and the value of good education (neither of which I have learnt yet!). I also
thank my wife Madhvi for her patience, her encouragement, and also for having tolerated my
long periods of silence and temper tantrums! Thanks (rather apologies) to my little daughters,
Surabhi and Sakshi, who tolerated Papa’s frequent refusals to take them on outings.
I thank Dr David Mulvaney and Dr Sekharjit Datta of the University of Loughborough for
their valuable guidance, encouragement, and inspiration. My teachers always encouraged me
to think big and to think independently. My sincerest gratitude to each one of them.
The editorial team of Oxford University Press deserves my heartfelt thanks for their
guidance and for their timely reminders about the deadlines I would have de¿nitely missed
otherwise!
Feedback about the book is most welcome. Readers are requested and encouraged to send
their feedback to the author’s mail id [email protected].

Sourav Sahay
Preface to the Second Edition

The object-oriented programming system (OOPS) enables a programmer to model real-world


objects. It allows the programmer to add characteristics like data security, data encapsulation,
etc.
In the procedure-oriented programming system, procedures are dissociated from data and
are not a part of it. Instead, they receive structure variables, or their addresses, and then work
upon them. The code design is centered around procedures. While this may sound obvious,
this programming pattern has its drawbacks, a major one being that the data is not secure. It
can be manipulated by any procedure.
It is the lack of data security of the procedure-oriented programming system that led to
OOPS, in which, with the help of a new programming construct and new keywords, associated
functions of the data structure can be given exclusive rights to work upon its variables.
There is another characteristic of real-world objects—a guaranteed initialization of data.
Programming languages that implement OOPS enable library programmers to incorporate this
characteristic of real-world objects into structure variables. Library programmers can ensure
a guaranteed initialization of data members of structure variables to the desired values. For
this, application programmers do not need to write code explicitly.
OOPS further supports the following concepts:
x Inheritance This feature allows a class to inherit the data and function members of an
existing class.
x Data abstraction Data abstraction is a virtue by which an object hides its internal
operations from the rest of the program.
x Modularity This feature supports dividing a program into small segments and implement
those segments using different functions.
x Polymorphism Through polymorphism, functions with different set of formal arguments
can have the same name.
The ¿rst edition had covered the fundamentals of the object oriented programming system
in depth. These explanations in the ¿rst edition hold true for any programming language that
supports OOPS. This second edition enhances coverage, as listed below.

New to this Edition


x New chapter on data structures containing new and original algorithms, especially an
elegant and simple recursive algorithm for inserting nodes into trees. The explanations
are elaborate and full of diagrams.
x New sections on explicit constructors, command line arguments, and re-throwing
exceptions.
iv Preface to the Second Edition

x Expanded glossary.
x Accompanying CD contains all the program codes given in the text.

Key Features
x Simple and concise language eases the understanding of complex concepts that have
made C++ powerful but enigmatic.
x Plenty of solved examples with complete program listings and test cases to reinforce
learning.
x Review questions and program writing exercises at the end of each chapter to provide
additional practice.
x Self-tests at the end of the book to prepare the students for examinations.

Organization of the Book


A brief knowledge of C language is a prerequisite for this book. The readers need to know
how programs are written in C, data types, decision-making and looping constructs, operators,
functions, header ¿les, pointers, and structures.
Chapter 1 contains an explanation of the procedure-oriented programming system, the
role played by structures in this system, its drawbacks and how these drawbacks led to the
creation of OOPS. The meaning and method of modelling real-world objects by the object-
oriented programming system have been clearly explained. The chapter includes a study of
the non-object-oriented features of C++.
Chapter 2 is devoted to the study of objects and classes. It gives a thorough explanation
of the class construct of C++. Superiority of the class construct of C++ over the structure
construct of C language is explained. A description of the various types and features of member
functions and member data is included. Other concepts included are namespaces, arrays of
objects, arrays in objects, and nested classes.
Chapter 3 deals with dynamic memory management. It explains the use of the new and the
delete operators. It also explains the method of specifying our own new handler for handling
out-of-memory conditions.
Chapter 4 explains constructors and destructors. It discusses their importance, their features,
and the method of de¿ning them.
Chapter 5 is devoted to inheritance. Concepts like base class, derived class, base class
pointer, and derived class pointer are covered. The protected keyword and the implications
of deriving by different access speci¿ers are explained. This chapter describes various types
of inheritance.
Chapter 6 gives a detailed explanation of one of the most striking features of C++—
dynamic polymorphism. This chapter describes the virtual functions and how it enables C++
programmers to extend class libraries. The importance of pure virtual functions and clone
functions is also explained.
Chapter 7 describes the standard C++ library for handling streams. It explains the two
types of input and output—text mode and binary mode. Input and output from disk ¿les are
explained. The chapter also describes the use of error-handling routines of the standard C++
stream library and manipulators.
Chapter 8 is devoted to operator overloading, type conversion, new style casts, and RTTI.
This chapter explains the various intricacies and the proper use of operator overloading.
This chapter also explains how a C++ programmer can implement conventional style type
Preface to the Second Edition v

conversions. New style casts for implementing type conversions are explained next. This
chapter ends with a treatment of run time type information (RTTI).
Chapter 9 explains and illustrates the most important data structures—linked lists and trees.
It includes full-Àedged programs that can be used to create various data structures.
Chapter 10 contains a detailed description of templates. The importance of function
templates and class templates and their utilization in code reuse is explained. This chapter
also provides an overview of the Standard Template Library (STL) of C++.
Chapter 11 explains the concept of exception handling. It begins with a section on
conventional methods and their drawbacks. This is followed by an explanation of the try-catch-
throw mechanism provided by C++ and its superiority over the conventional methods.
The appendices in the book include a case study, comparison of C++ with C, comparison
of C++ with Java, an overview of object-oriented analysis and design, and self tests.

Acknowledgements
The blessings of my parents continue to give me the courage I need to overcome the obstacles
that are associated with dif¿cult ventures like writing books. Every achievement of my life,
including this book, is because of the valuable education they gave me early in my life. Thanks
to my wife Madhvi against whose wishes I decided to spend most of the weekends over the
last 2 years on my laptop writing this edition. My daughters Surabhi and Sakshi continue to
inspire and motivate me.
Thanks to Professor Shanmuka Swamy, Assistant Professor in the Sridevi Institute of
Engineering and Technology, Tumkur, for pointing out a couple of printing mistakes in the
¿rst edition. These have been corrected.
The editorial staff members of the Oxford University Press deserve a special mention for
its support and prompt responses.
Please continue to send your valuable feedback and questions to my e-mail id
[email protected].
Sourav Sahay
Brief Contents

Preface to the Second Edition iii

Preface to the First Edition vi

Detailed Contents xi

1. Introduction to C++ 1
2. Classes and Objects 31
3. Dynamic Memory Management 78
4. Constructors and Destructors 92
5. Inheritance 117
6. Virtual Functions and Dynamic Polymorphism 153
7. Stream and File Handling 172
8. Operator Overloading, Type Conversion, New Style Casts, and RTTI 211
9. Data Structures 283
10. Templates 372
11. Exception Handling 393

Appendix A: Case Study—A Word Query System 417


Appendix B: Comparison of C++ with C 425
Appendix C: Comparison of C++ with Java 427
Appendix D: Object-Oriented Analysis and Design 437
Appendix E: Glossary 449
Appendix F: Self Tests 454

Bibliography 460

Index 461
Detailed Contents

Preface to the Second Edition iii


Preface to the First Edition vi
Brief Contents ix

1. Introduction to C++ 1
1.1 A Review of Structures 1
1.1.1 The Need for Structures 1
1.1.2 Creating a New Data Type Using Structures 4
1.1.3 Using Structures in Application Programs 5
1.2 Procedure-Oriented Programming Systems 5
1.3 Object-Oriented Programming Systems 7
1.4 Comparison of C++ with C 8
1.5 Console Input/Output in C++ 9
1.5.1 Console Output 9
1.5.2 Console Input 12
1.6 Variables in C++ 13
1.7 Reference Variables in C++ 14
1.8 Function Prototyping 19
1.9 Function Overloading 21
1.10 Default Values for Formal Arguments of Functions 23
1.11 Inline Functions 25

2. Classes and Objects 31


2.1 Introduction to Classes and Objects 31
2.1.1 Private and Public Members 33
2.1.2 Objects 36
2.1.3 Scope Resolution Operator 37
2.1.4 Creating Libraries Using the Scope Resolution Operator 38
2.1.5 Using Classes in Application Programs 39
2.1.6 this Pointer 40
2.1.7 Data Abstraction 45
2.1.8 Explicit Address Manipulation 47
2.1.9 Arrow Operator 47
2.1.10 Calling One Member Function from Another 48
xii Detailed Contents

2.2 Member Functions and Member Data 49


2.2.1 Overloaded Member Functions 49
2.2.2 Default Values for Formal Arguments of Member Functions 51
2.2.3 Inline Member Functions 52
2.2.4 Constant Member Functions 52
2.2.5 Mutable Data Members 54
2.2.6 Friends 54
2.2.7 Static Members 59
2.3 Objects and Functions 65
2.4 Objects and Arrays 66
2.4.1 Arrays of Objects 67
2.4.2 Arrays Inside Objects 67
2.5 Namespaces 68
2.6 Nested Inner Classes 71

3. Dynamic Memory Management 78


3.1 Introduction 78
3.2 Dynamic Memory Allocation 79
3.3 Dynamic Memory Deallocation 84
3.4 set_new_handler() function 88

4. Constructors and Destructors 92


4.1 Constructors 92
4.1.1 Zero-argument Constructor 94
4.1.2 Parameterized Constructors 97
4.1.3 Explicit Constructors 103
4.1.4 Copy Constructor 105
4.2 Destructors 109
4.3 Philosophy of OOPS 112

5. Inheritance 117
5.1 Introduction 117
5.1.1 Effects of Inheritance 118
5.1.2 Bene¿ts of Inheritance 120
5.1.3 Inheritance in Actual Practice 120
5.1.4 Base Class and Derived Class Objects 121
5.1.5 Accessing Members of the Base Class in the Derived Class 121
5.2 Base Class and Derived Class Pointers 122
5.3 Function Overriding 127
5.4 Base Class Initialization 129
5.5 Protected Access Speci¿er 132
5.6 Deriving by Different Access Speci¿ers 133
5.6.1 Deriving by the Public Access Speci¿er 133
5.6.2 Deriving by the Protected Access Speci¿er 135
5.6.3 Deriving by the Private Access Speci¿er 136
5.7 Different Kinds of Inheritance 139
5.7.1 Multiple Inheritance 139
5.7.2 Ambiguities in Multiple Inheritance 141
Detailed Contents xiii

5.7.3 Multi-level Inheritance 145


5.7.4 Hierarchical Inheritance 147
5.7.5 Hybrid Inheritance 148
5.8 Order of Invocation of Constructors and Destructors 149

6. Virtual Functions and Dynamic Polymorphism 153


6.1 Need for Virtual Functions 153
6.2 Virtual Functions 156
6.3 Mechanism of Virtual Functions 160
6.4 Pure Virtual Functions 162
6.5 Virtual Destructors and Virtual Constructors 167
6.5.1 Virtual Destructors 167
6.5.2 Virtual Constructors 168

7. Stream and File Handling 172


7.1 Streams 172
7.2 Class Hierarchy for Handling Streams 172
7.3 Text and Binary Input/Output 174
7.3.1 Data Storage in Memory 174
7.3.2 Input/Output of Character Data 175
7.3.3 Input/Output of Numeric Data 175
7.3.4 Note on Opening Disk Files for I/O 176
7.4 Text Versus Binary Files 176
7.5 Text Output/Input 177
7.5.1 Text Output 177
7.5.2 Text Input 181
7.6 Binary Output/Input 185
7.6.1 Binary Output—write() Function 185
7.6.2 Binary Input—read() Function 189
7.7 Opening and Closing Files 193
7.7.1 open() Function 193
7.7.2 close() Function 194
7.8 Files as Objects of the fstream Class 194
7.9 File Pointers 194
7.9.1 seekp() Function 195
7.9.2 tellp() Function 196
7.9.3 seekg() Function 196
7.9.4 tellg() Function 196
7.10 Random Access to Files 197
7.11 Object Input/Output Through Member Functions 197
7.12 Error Handling 199
7.12.1 eof() Function 199
7.12.2 fail() Function 199
7.12.3 bad() Function 200
7.12.4 clear() Function 200
7.13 Manipulators 201
7.13.1 Pre-de¿ned Manipulators 201
xiv Detailed Contents

7.13.2 User-de¿ned Manipulators 203


7.14 Command Line Arguments 204

8. Operator Overloading, Type Conversion, New Style Casts, and RTTI 211
8.1 Operator Overloading 211
8.1.1 Overloading Operators—The Syntax 212
8.1.2 Compiler Interpretation of Operator-Overloading Functions 214
8.1.3 Overview of Overloading Unary and Binary Operators 216
8.1.4 Operator Overloading 216
8.1.5 Rules for Operator Overloading 219
8.2 Overloading Various Operators 221
8.2.1 Overloading Increment and Decrement Operators
(Pre¿x and Post¿x) 221
8.2.2 Overloading Unary Minus and Unary Plus Operator 224
8.2.3 Overloading Arithmetic Operators 225
8.2.4 Overloading Relational Operators 230
8.2.5 Overloading Assignment Operator 234
8.2.6 Overloading Insertion and Extraction Operators 240
8.2.7 Overloading new and delete Operators 244
8.2.8 Overloading Subscript Operator 261
8.2.9 Overloading Pointer-to-member (->) Operator (Smart Pointer) 265
8.3 Type Conversion 267
8.3.1 Basic Type to Class Type 267
8.3.2 Class Type to Basic Type 268
8.3.3 Class Type to Class Type 269
8.4 New Style Casts and the typeid Operator 271
8.4.1 dynamic_cast Operator 271
8.4.2 static_cast Operator 275
8.4.3 reinterpret_cast Operator 276
8.4.4 const_cast Operator 276
8.4.5 typeid Operator 277

9. Data Structures 283


9.1 Introduction 283
9.2 Linked Lists 284
9.3 Stacks 336
9.4 Queues 340
9.5 Trees 343
9.5.1 Binary Trees 344
9.5.2 Binary Search Trees 347

10. Templates 372


10.1 Introduction 372
10.2 Function Templates 373
10.3 Class Templates 378
10.3.1 Nested Class Templates 382
10.4 Standard Template Library 382
10.4.1 list Class 383
Detailed Contents xv

10.4.2 vector Class 386


10.4.3 pair Class 387
10.4.4 map Class 387
10.4.5 set Class 389
10.4.6 multimap Class 389
10.4.7 multiset Class 390

11. Exception Handling 393


11.1 Introduction 393
11.2 C-Style Handling of Error-generating Code 394
11.2.1 Terminate the Program 394
11.2.2 Check the Parameters before Function Call 395
11.2.3 Return a Value Representing an Error 396
11.3 C++-Style Solution—the try/throw/catch Construct 397
11.3.1 It is Necessary to Catch Exceptions 400
11.3.2 Unwinding of the Stack 401
11.3.3 Need to Throw Class Objects 404
11.3.4 Accessing the Thrown Object in the Catch Block 406
11.3.5 Throwing Parameterized Objects of a Nested Exception Class 408
11.3.6 Catching Uncaught Exceptions 409
11.3.7 Re-throwing Exceptions 410
11.4 Limitation of Exception Handling 414

Appendix A: Case Study—A Word Query System 417


Problem Statement 417
A Sample Run 417
The Source Code 418
Explanation of the Code 420

Appendix B: Comparison of C++ with C 425


Non-object-oriented Features Provided in C++ that are Absent in C
Language 425
Object-oriented Features Provided in C++ to make it Comply with the
Requirements of the Object-Oriented Programming System 426

Appendix C: Comparison of C++ with Java 427


C.1 Similarities between C++ and Java 427
C.2 Differences between C++ and Java 428

Appendix D: Object-Oriented Analysis and Design 437


D.1 Introduction 437
Why Build Models? 437
Overview of OOAD 437
D.2 Object-Oriented Model 438
Object Model 438
Dynamic Model 442
Functional Model 444
D.3 Analysis 446
xvi Detailed Contents

Overview of Analysis 446


Object Modelling 446
Dynamic Modelling 446
Functional Modelling 447
D.4 System Design 447
Breaking the System into Sub-systems 447
Layers 447
Partitions 447
D.5 Object Design 448
Overview of Object Design 448
D.6 Implementation 448

Appendix E: Glossary 449

Appendix F: Self Tests 454


Test 1 454
Test 2 456
Test 3 458

Bibliography 460

Index 461
1 Introduction to C++

O This chapter introduces the reader to the fundamentals of object-oriented programming systems
(OOPS).
V The chapter begins with an overview of structures, the reasons for their inclusion as a
E language construct in C language, and their role in procedure-oriented programming systems.
Use of structures for creating new data types is described. Also, the drawbacks of structures
R and the development of OOPS are elucidated.
The middle section of the chapter explains OOPS, supplemented with suitable examples
V and analogies to help in understanding this tricky subject.
I The concluding section of the chapter includes a study of a number of new features that are
implemented by C++ compilers but do not fall under the category of object-oriented features.
E (Language constructs of C++ that implement object-oriented features are dealt with in the
W next chapter.)

1.1 A Review of Structures


In order to understand procedure-oriented programming systems, let us ¿rst recapitulate our
understanding of structures in C. Let us review their necessity and use in creating new data
types.

1.1.1 The Need for Structures


There are cases where the value of one variable depends upon that of another variable.
Take the example of date. A date can be programmatically represented in C by three
different integer variables taken together. Say,
int d,m,y; //three integers for representing dates

Here ‘d’, ‘m’, and ‘y’ represent the day of the month, the month, and the year, respectively.
Observe carefully. Although these three variables are not grouped together in the code, they
actually belong to the same group. The value of one variable may inÀuence the value of the
other two. In order to understand this clearly, consider a function next_day() that accepts
the addresses of the three integers that represent a date and changes their values to represent
the next day. The prototype of this function will be
void next_day(int *,int *,int *); //function to calculate
//the next day
2 Object-Oriented Programming with C++

Suppose,
d=1;
m=1;
y=2002; //1st January, 2002

Now, if we write
next_day(&d,&m,&y);

‘d’ will become 2, ‘m’ will remain 1, and ‘y’ will remain 2002.
But if
d=28;
m=2;
y=1999; //28th February, 1999

and we call the function as


next_day(&d,&m,&y);

‘d’ will become 1, ‘m’ will become 3, and ‘y’ will remain 1999.
Again, if
d=31;
m=12;
y=1999; //31st December, 1999

and we call the function as


next_day(&d,&m,&y);

‘d’ will become 1, ‘m’ will become 1, and ‘y’ will become 2000.
As you can see, ‘d’, ‘m’, and ‘y’ actually belong to the same group. A change in the value
of one may change the value of the other two. But there is no language construct that actually
places them in the same group. Thus, members of the wrong group may be accidentally sent
to the function (Listing 1.1)!

Listing 1.1 Problem in passing groups of programmatically independent but logically


dependent variable
d1=28; m1=2; y1=1999; //28th February, 1999
d2=19; m2=3; y2=1999; //19th March, 1999
next_day(&d1,&m1,&y1); //OK
next_day(&d1,&m2,&y2); //What? Incorrect set passed!

As can be observed in Listing 1.1, there is nothing in the language itself that prevents the
wrong set of variables from being sent to the function. Moreover, integer-type variables that
are not meant to represent dates might also be sent to the function!
Let us try arrays to solve the problem. Suppose the next_day() function accepts an array
as a parameter. Its prototype will be
void next_day(int *);

Let us declare date as an array of three integers.


int date[3];
date[0]=28;
date[1]=2;
date[2]=1999; //28th February, 1999
Introduction to C++ 3

Now, let us call the function as follows:


next_day(date);

The values of ‘date[0]’, ‘date[1]’, and ‘date[2]’ will be correctly set to 1, 3, and 1999,
respectively. Although this method seems to work, it certainly appears unconvincing. After
all any integer array can be passed to the function, even if it does not necessarily represent
a date. There is no data type of date itself. Moreover, this solution of arrays will not work if
the variables are not of the same type. The solution to this problem is to create a data type
called date itself using structures
struct date //a structure to represent dates
{
int d, m, y;
};

Now, the next_day() function will accept the address of a variable of the structure date
as a parameter. Accordingly, its prototype will be as follows:
void next_day(struct date *);

Let us now call it as shown in Listing 1.2.

Listing 1.2 The need for structures

struct date d1;


d1.d=28;
d1.m=2;
d1.y=1999;
next_day(&d1);

‘d1.d’, ‘d1.m’, and ‘d1.y’ will be correctly set to 1, 3, and 1999, respectively. Since the
function takes the address of an entire structure variable as a parameter at a time, there is no
chance of variables of the different groups being sent to the function.
Structure is a programming construct in C that allows us to put together variables that
should be together.
Library programmers use structures to create new data types. Application programs and
other library programs use these new data types by declaring variables of this data type.
struct date d1;

They call the associated functions by passing these variables or their addresses to them.
d1.d=31;
d1.m=12;
d1.y=2003;
next_day(&d1);

Finally, they use the resultant value of the passed variable further as per requirements.
printf(“The next day is: %d/%d/%d\n”, d1.d, d1.m, d1.y);

Output
The next day is: 01/01/2004
4 Object-Oriented Programming with C++

1.1.2 Creating a New Data Type Using Structures


Creation of a new data type using structures is loosely a three-step process that is executed
by the library programmer.
Step 1: Put the structure de¿nition and the prototypes of the associated functions in a header
¿le, as shown in Listing 1.3.
Listing 1.3 Header file containing definition of a structure variable and prototypes of its
associated functions
/*Beginning of date.h*/
/*This file contains the structure definition and
prototypes of its associated functions*/
struct date
{
int d,m,y;
};
void next_day(struct date *); //get the next date
void get_sys_date(struct date *); //get the current
//system date
/*
Prototypes of other useful and relevant functions to
work upon variables of the date structure
*/
/*End of date.h*/

Step 2: As shown in Listing 1.4, put the de¿nition of the associated functions in a source
code and create a library.

Listing 1.4 Defining the associated functions of a structure

/*Beginning of date.c*/
/*This file contains the definitions of the associated
functions*/
#include “date.h”
void next_day(struct date * p)
{
//calculate the date that immediately follows the one
//represented by *p and set it to *p.
}
void get_sys_date(struct date * p)
{
//determine the current system date and set it to *p
}
/*
Definitions of other useful and relevant functions to work upon variables
of the date structure
*/
/*End of date.c*/

Step 3: Provide the header ¿le and the library, in whatever media, to other programmers who
want to use this new data type.
Creation of a structure and creation of its associated functions are two separate steps that
together constitute one complete process.
Introduction to C++ 5

1.1.3 Using Structures in Application Programs


The steps to use this new data type are as follows:
Step 1: Include the header ¿le provided by the library programmer in the source code.
/*Beginning of dateUser.c*/
#include“date.h”
void main( )
{
. . . .
. . . .
}
/*End of dateUser.c*/

Step 2: Declare variables of the new data type in the source code.
/*Beginning of dateUser.c*/
#include“date.h”
void main( )
{
struct date d;
. . . .
. . . .
}
/*End of dateUser.c*/

Step 3: As shown in Listing 1.5, embed calls to the associated functions by passing these
variables in the source code.

Listing 1.5 Using a structure in an application program

/*Beginning of dateUser.c*/
#include“date.h”
void main()
{
struct date d;
d.d=28;
d.m=2;
d.y=1999;
next_day(&d);
. . . .
. . . .
}
/*End of dateUser.c*/

Step 4: Compile the source code to get the object ¿le.


Step 5: Link the object ¿le with the library provided by the library programmer to get the
executable or another library.

1.2 Procedure-Oriented Programming Systems


In light of the previous discussion, let us understand the procedure-oriented programming
system. The foregoing pattern of programming divides the code into functions. Data (contained
in structure variables) is passed from one function to another to be read from or written into.
The focus is on procedures. This programming pattern is, therefore, a feature of the procedure-
oriented programming system.
6 Object-Oriented Programming with C++

In the procedure-oriented programming system, procedures are dissociated from data and
are not a part of it. Instead, they receive structure variables or their addresses and work upon
them. The code design is centered around procedures. While this may sound obvious, this
programming pattern has its drawbacks.
The drawback with this programming pattern is that the data is not secure. It can be
manipulated by any procedure. Associated functions that were designed by the library
programmer do not have the exclusive rights to work upon the data. They are not a part of
the structure de¿nition itself. Let us see why this is a problem.
Suppose the library programmer has de¿ned a structure and its associated functions as
described above. Further, in order to perfect his/her creation, he/she has rigorously tested
the associated functions by calling them from small test applications. Despite his/her best
efforts, he/she cannot be sure that an application that uses the structure will be bug free. The
application program might modify the structure variables, not by the associated function he/
she has created, but by some code inadvertently written in the application program itself.
Compilers that implement the procedure-oriented programming system do not prevent
unauthorized functions from accessing/manipulating structure variables.
Now, let us look at the situation from the application programmer’s point of view. Consider
an application of around 25,000 lines (quite common in the real programming world), in
which variables of this structure have been used quite extensively. During testing, it is found
that the date being represented by one of these variables has become 29th February 1999!
The faulty piece of code that is causing this bug can be anywhere in the program. Therefore,
debugging will involve a visual inspection of the entire code (of 25000 lines!) and will not
be limited to the associated functions only.
The situation becomes especially grave if the execution of the code that is likely to corrupt
the data is conditional. For example,
if(<some condition>)
d.m++; //d is a variable of date structure… d.m may
//become 13!

The condition under which the bug-infested code executes may not arise during testing.
While distributing his/her application, the application programmer cannot be sure that it would
run successfully. Moreover, every new piece of code that accesses structure variables will
have to be visually inspected and tested again to ensure that it does not corrupt the members
of the structure. After all, compilers that implement procedure-oriented programming systems
do not prevent unauthorized functions from accessing/manipulating structure variables.
Let us think of a compiler that enables the library programmer to assign exclusive rights to
the associated functions for accessing the data members of the corresponding structure. If this
happens, then our problem is solved. If a function which is not one of the intended associated
functions accesses the data members of a structure variable, a compile-time error will result.
To ensure a successful compile of his/her application code, the application programmer will
be forced to remove those statements that access data members of structure variables. Thus,
the application that arises out of a successful compile will be the outcome of a piece of code
that is free of any unauthorized access to the data members of the structure variables used
therein. Consequently, if a run-time error arises, attention can be focused on the associated
library functions.
It is the lack of data security of procedure-oriented programming systems that led to object-
oriented programming systems (OOPS). This new system of programming is the subject of
our next discussion.
Introduction to C++ 7

1.3 Object-Oriented Programming Systems


In OOPS, we try to model real-world objects. But, what are real-world objects? Most real-
world objects have internal parts and interfaces that enable us to operate them. These interfaces
perfectly manipulate the internal parts of the objects. They also have the exclusive rights to
do so.
Let us understand this concept with the help of an example. Take the case of a simple
LCD projector (a real-world object). It has a fan and a lamp. There are two switches—one to
operate the fan and the other to operate the lamp. However, the operation of these switches is
necessarily governed by rules. If the lamp is switched on, the fan should automatically switch
itself on. Otherwise, the LCD projector will get damaged. For the same reason, the lamp should
automatically get switched off if the fan is switched off. In order to cater to these conditions,
the switches are suitably linked with each other. The interface to the LCD projector is perfect.
Further, this interface has the exclusive rights to operate the lamp and fan.
This, in fact, is a common characteristic of all real-world objects. If a perfect interface is
required to work on an object, it will also have exclusive rights to do so.
Coming back to C++ programming, we notice a resemblance between the observed
behaviour of the LCD projector and the desired behaviour of data structure’s variables. In
OOPS, with the help of a new programming construct and new keywords, associated functions
of the data structure can be given exclusive rights to work upon its variables. In other words,
all other pieces of code can be prevented from accessing the data members of the variables
of this structure.
Compilers that implement OOPS enable data security by diligently enforcing this
prohibition. They do this by throwing compile-time errors against pieces of code that violate
the prohibition. This prohibition, if enforced, will make structure variables behave like real-
world objects. Associated functions that are de¿ned to perfectly manipulate structure variables
can be given exclusive rights to do so.
There is still another characteristic of real-world objects—a guaranteed initialization of
data. After all, when you connect the LCD projector to the mains, it does not start up in an
invalid state (fan off and lamp on). By default, either both the lamp and the fan are off or
both are on. Users of the LCD projector need not do this explicitly. The same characteristic
is found in all real-world objects.
Programming languages that implement OOPS enable library programmers to incorporate
this characteristic of real-world objects into structure variables. Library programmers can
ensure a guaranteed initialization of data members of structure variables to the desired values.
For this, application programmers do not need to write code explicitly.
Two more features are incidental to OOPS. They are:
x Inheritance
x Polymorphism
Inheritance allows one structure to inherit the characteristics of an existing structure.
As we know from our knowledge of structures, a variable of the new structure will contain
data members mentioned in the new structure’s de¿nition. However, because of inheritance,
it will also contain data members mentioned in the existing structure’s de¿nition from which
the new structure has inherited.
Further, associated functions of the new structure can work upon a variable of the new
structure. For this, the address/name of a variable of the new structure is passed to the associated
functions of the new structure. Again, as a result of inheritance, associated functions of the
existing structure from which the new structure has inherited will also be able to work upon
8 Object-Oriented Programming with C++

a variable of the new structure. For this, the address/name of a variable of the new structure
is passed to the associated functions of the existing structure.
In inheritance, data and interface may both be inherited. This is expected as data and
interface complement each other. The parent structure can be given the general common
characteristics while its child structures can be given the more speci¿c characteristics. This
allows code reusability by keeping the common code in a common place—the base structure.
Otherwise, the code would have to be replicated in all of the child structures, which will
lead to maintenance nightmares. Inheritance also enables code extensibility by allowing
the creation of new structures that are better suited to our requirements as compared to the
existing structures.
Polymorphism, as the name suggests, is the phenomena by virtue of which the same entity
can exist in two or more forms. In OOPS, functions can be made to exhibit polymorphic
behaviour. Functions with different set of formal arguments can have the same name.
Polymorphism is of two types: static and dynamic. We will understand how this feature enables
C++ programmers to reuse and extend existing code in the subsequent chapters.

1.4 Comparison of C++ with C


C++ is an extension of C language. It is a proper superset of C language. This means that
a C++ compiler can compile programs written in C language. However, the reverse is not
true. A C++ compiler can understand all the keywords that a C compiler can understand.
Again, the reverse is not true. Decision-making constructs, looping constructs, structures,
functions, etc. are written in exactly the same way in C++ as they are in C language. Apart
from the keywords that implement these common programming constructs, C++ provides
a number of additional keywords and language constructs that enable it to implement the
object-oriented paradigm.
The header ¿le given in Listing 1.6 shows how the structure Date, which has been our
running example so far, can be rewritten in C++.
Listing 1.6 Redefining the Date structure in C++

/*Beginning of Date.h*/
class Date //class instead of structure
{
private:
int d,m,y;
public:
Date();
void get_sys_date(); //associated functions appear
//within the class definition
void next_day();
};
/*End of Date.h*/

The following differences can be noticed between Date structure in C (Listing 1.3) and C++
(Listing 1.6):
x The keyword class has been used instead of struct.
x Two new keywords—private and public—appear in the code.
x Apart from data members, the class constructor also has member functions.
x A function that has the same name as the class itself is also present in the class. Incidentally,
it has no return type specified. This is the class constructor and is discussed in Chapter 4
of this book.
Introduction to C++ 9

The next chapter contains an in-depth study of the above class construct. It explains the
meaning and implications of this new feature. It also explains how this and many more
new features implement the features of OOPS, such as data hiding, data encapsulation, data
abstraction, and a guaranteed initialization of data. However, before proceeding to Chapter
2, let us digress slightly and study the following:
x Console input/output in C++
x Some non-object-oriented features provided exclusively in C++ (reference variables,
function overloading, default arguments, inline functions)
Remember that C++ program ¿les have the extension ‘.cpp’ or ‘.C’. The former extension
is normally used for Windows or DOS-based compilers while the latter is normally used
for UNIX-based compilers. The compiler’s manual can be consulted to ¿nd out the exact
extension.

1.5 Console Input/Output in C++


This section discusses console input and output in C++.

1.5.1 Console Output


The output functions in C language, such as printf(), can be included in C++ programs
because they are anyway de¿ned in the standard library. However, there are some more ways
of outputting to the console in C++. Let us consider an example (see Listing 1.7).

Listing 1.7 Outputting in C++

/*Beginning of cout.cpp*/
#include<iostream.h>
void main()
{
int x;
x=10;
cout<<x; //outputting to the console
}
/*End of cout.cpp*/

Output
10

The third statement in the main() function (Listing 1.7) needs to be understood.
cout (pronounce see-out) is actually an object of the class ostream_withassign (you can
think of it as a variable of the structure ostream_withassign). It stands as an alias for the
console output device, that is, the monitor (hence the name).
The << symbol, originally the left shift operator, has had its de¿nition extended in C++.
In the given context, it operates as the insertion operator. It is a binary operator. It takes
two operands. The operand on its left must be some object of the ostream class. The operand
on its right must be a value of some fundamental data type. The value on the right side of
the insertion operator is ‘inserted’ (hence the name) into the stream headed towards the
device associated with the object on the left. Consequently, the value of ‘x’ is displayed on
the monitor.
The ¿le iostream.h needs to be included in the source code to ensure successful compilation
because the object cout and the insertion operator have been declared in that ¿le.
10 Object-Oriented Programming with C++

Another object endl allows us to insert a new line into the output stream. Listing 1.8
illustrates this.

Listing 1.8 Inserting new line by ‘endl’

/*Beginning of endl.cpp*/
#include<iostream.h>
void main()
{
int x,y;
x=10;
y=20;
cout<<x;
cout<<endl; //inserting a new line by endl
cout<<y;
}
/*End of endl.cpp*/

Output
10
20

One striking feature of the insertion operator is that it works equally well with values of
all fundamental types as its right-hand operand. It does not need the format speci¿ers that are
needed in the printf() family of functions. Listing 1.9 exempli¿es this.

Listing 1.9 Outputting data with the insertion operator

/*Beginning of cout.cpp*/
#include<iostream.h>
void main()
{
int iVar;
char cVar;
float fVar;
double dVar;
char * cPtr;
iVar=10;
cVar=‘x’;
fVar=2.3;
dVar=3.14159;
cPtr=“Hello World”;
cout<<iVar;
cout<<endl;
cout<<cVar;
cout<<endl;
cout<<fVar;
cout<<endl;
cout<<dVar;
cout<<endl;
cout<<cPtr;
cout<<endl;
}
/*End of cout.cpp*/
Introduction to C++ 11

Output
10
x
2.3
3.14159
Hello World

Just like the arithmetic addition operator, it is possible to cascade the insertion operator.
Listing 1.10 is a case in point.

Listing 1.10 Cascading the insertion operator

/*Beginning of coutCascade.cpp*/
#include<iostream.h>
void main()
{
int x;
float y;
x=10;
y=2.2;
cout<<x<<endl<<y; //cascading the insertion operator
}
/*End of coutCascade.cpp*/

Output
10
2.2

It is needless to say that we can pass constants instead of variables as operands to the insertion
operator, as shown in Listing 1.11.

Listing 1.11 Outputting constants using the insertion operator

/*Beginning of coutMixed.cpp*/
#include<iostream.h>
void main()
{
cout<<10<<endl<<“Hello World\n”<<3.4;
}
/*End of coutMixed.cpp*/

Ouput
10
Hello World
3.4

In Listing 1.11, note the use of the new line character in the string that is passed as one of the
operands to the insertion operator.
It was mentioned in the beginning of this section that cout is an object that is associated
with the console. Hence, if it is the left-hand side operand of the insertion operator, the
value on the right is displayed on the monitor. You will learn in the chapter on stream handling
that it is possible to pass objects of some other classes that are similarly associated with disk
12 Object-Oriented Programming with C++

¿les as the left-hand side operand to the insertion operator. In such cases, the values on
the right get stored in the associated ¿les.

1.5.2 Console Input


The input functions in C language, such as scanf(), can be included in C++ programs because
they are anyway de¿ned in the standard library. However, we do have some more ways of
inputting from the console in C++. Let us consider an example.

Listing 1.12 Inputting in C++

/*Beginning of cin.cpp*/
#include<iostream.h>
void main()
{
int x;
cout<<“Enter a number: ”;
cin>>x; //console input in C++
cout<<“You entered: ”<<x;
}
/*End of cin.cpp*/

Output
Enter a number: 10<enter>
You entered: 10

The third statement in the main() function of Listing 1.12 needs to be understood.
cin (pronounce see-in) is actually an object of the class istream_withassign (you can
think of it as a variable of the structure istream_withassign). It stands as an alias for the
console input device, that is, the keyboard (hence the name).
The >> symbol, originally the right-shift operator, has had its de¿nition extended in C++.
In the given context, it operates as the extraction operator. It is a binary operator and takes
two operands. The operand on its left must be some object of the istream_withassign class.
The operand on its right must be a variable of some fundamental data type. The value for the
variable on the right side of the extraction operator is extracted (hence the name) from the
stream originating from the device associated with the object on the left. Consequently, the
value of ‘x’ is obtained from the keyboard.
The ¿le iostream.h needs to be included in the source code to ensure successful compilation
because the object cin and the extraction operator have been declared in that ¿le.
Again, just like the insertion operator, the extraction operator works equally well
with variables of all fundamental types as its right-hand operand. It does not need the format
speci¿ers that are needed in the scanf() family of functions. Listing 1.13 exempli¿es this.

Listing 1.13 Inputting data with the extraction operator

/*Beginning of cin.cpp*/
#include<iostream.h>
void main()
{
int iVar;
Introduction to C++ 13

char cVar;
float fVar;
cout<<“Enter a whole number: ”;
cin>>iVar;
cout<<“Enter a character: ”;
cin>>cVar;
cout<<“Enter a real number: ”;
cin>>fVar;
cout<<“You entered: ”<<iVar<<“ ”<<cVar<<“ ”<<fVar;
}
/*End of cin.cpp*/

Output
Enter a whole number: 10<enter>
Enter a character: x<enter>
Enter a real number: 2.3<enter>
You entered: 10 x 2.3

Just like the insertion operator, it is possible to cascade the extraction operator. Listing
1.14 is a case in point.

Listing 1.14 Cascading the extraction operator

/*Beginning of cinCascade.cpp*/
#include<iostream.h>
void main()
{
int x,y;
cout<<“Enter two numbers\n”;
cin>>x>>y; //cascading the extraction operator
cout<<“You entered ”<<x<<“ and ”<<y;
}
/*End of cinCascade.cpp*/

Output
Enter two numbers
10<enter>
20<enter>
You entered 10 and 20

It was mentioned in the beginning of this section that cin is an object that is associated with
the console. Hence, if it is the left-hand side operand of the extraction operator, the variable
on the right gets its value from the keyboard. You will learn in the chapter on stream handling
that it is possible to pass objects of some other classes that are similarly associated with disk
¿les as the left-hand side operand to the extraction operator. In such cases, the variable on
the right gets its value from the associated ¿les.

1.6 Variables in C++


Variables in C++ can be declared anywhere inside a function and not necessarily at its very
beginning. For example, see Listing 1.15.
14 Object-Oriented Programming with C++

Listing 1.15 Declaring variables in C++

#include<iostream.h>
void main()
{
int x;
x=10;
cout<<“Value of x= ”<<x<<endl;
int * iPtr; //declaring a variable in the middle of a
//function
iPtr=&x;
cout<<“Address of x= ”<<iPtr<<endl;
}

Output
Value of x=10
Address of x= 0x21878163

1.7 Reference Variables in C++


First, let us understand the basics. How does the operating system (OS) display the value of
variables? How are assignment operations such as ‘x=y’ executed during run time? A detailed
answer to these questions is beyond the scope of this book. A brief study is, nevertheless,
possible and necessary for a good understanding of reference variables. What follows is a
simpli¿ed and tailored explanation.
The OS maintains the addresses of each variable as it allocates memory for them during run
time. In order to access the value of a variable, the OS ¿rst ¿nds the address of the variable
and then transfers control to the byte whose address matches that of the variable.
Suppose the following statement is executed (‘x’ and ‘y’ are integer type variables).
x=y;

The steps followed are:


1. The OS first finds the address of ‘y’.
2. The OS transfers control to the byte whose address matches this address.
3. The OS reads the value from the block of four bytes that starts with this byte (most C++
compilers cause integer-type variables to occupy four bytes during run time and we will
accept this value for our purpose).
4. The OS pushes the read value into a temporary stack.
5. The OS finds the address of ‘x’.
6. The OS transfers control to the byte whose address matches this address.
7. The OS copies the value from the stack, where it had put it earlier, into the block of four
bytes that starts with the byte whose address it has found above (address of ‘x’).
Notice that addresses of the variables on the left as well as on the right of the assignment
operator are determined. However, the value of the right-hand operand is also determined. The
expression on the right must be capable of being evaluated to a value. This is an important
point and must be borne in mind. It will enable us to understand a number of concepts later.
Introduction to C++ 15

Especially, you must remember that the expression on the left of the assignment operator
must be capable of being evaluated to a valid address at which data can be written.
Now, let us study reference variables. A reference variable is nothing but a reference for
an existing variable. It shares the memory location with an existing variable. The syntax for
declaring a reference variable is as follows:
<data-type> & <ref-var-name>=<existing-var-name>;

For example, if ‘x’ is an existing integer-type variable and we want to declare iRef as a
reference to it the statement is as follows:
int & iRef=x;

iRef is a reference to ‘x’. This means that although iRef and ‘x’ have separate entries in the
OS, their addresses are actually the same!
Thus, a change in the value of ‘x’ will naturally reflect in iRef and vice versa.
Listing 1.16 illustrates this.

Listing 1.16 Reference variables

/*Beginning of reference01.cpp*/
#include<iostream.h>
void main()
{
int x;
x=10;
cout<<x<<endl;
int & iRef=x; //iRef is a reference to x
iRef=20; //same as x=10;
cout<<x<<endl;
x++; //same as iRef++;
cout<<iRef<<endl;
}
/*End of reference01.cpp*/

Output
10
20
21

Reference variables must be initialized at the time of declaration (otherwise the compiler will
not know what address it has to record for the reference variable).
Reference variables are variables in their own right. They just happen to have the address
of another variable. After their creation, they function just like any other variable.
We have just seen what happens when a value is written into a reference variable. The
value of a reference variable can be read in the same way as the value of an ordinary variable
is read. Listing 1.17 illustrates this.

Listing 1.17 Reading the value of a reference variable

/*Beginning of reference02.cpp*/
#include<iostream.h>
void main()
{
16 Object-Oriented Programming with C++

int x,y;
x=10;
int & iRef=x;
y=iRef; //same as y=x;
cout<<y<<endl;
y++; //x and iRef unchanged
cout<<x<<endl<<iRef<<endl<<y<<endl;
}
/*End of reference02.cpp*/

Output
10
10
10
11

A reference variable can be a function argument and thus change the value of the parameter
that is passed to it in the function call. Listing 1.18 is an illustrative example.

Listing 1.18 Passing by reference

/*Beginning of reference03.cpp*/
#include<iostream.h>
void increment(int &); //formal argument is a reference
//to the passed parameter
void main()
{
int x;
x=10;
increment(x);
cout<<x<<endl;
}
void increment(int & r)
{
r++; //same as x++;
}
/*End of reference03.cpp*/

Output
11

Functions can return by reference also. See Listing 1.19.

Listing 1.19 Returning by reference

/*Beginning of reference04.cpp*/
#include<iostream.h>
int & larger(int &, int &);
int main()
{
int x,y;
x=10;
y=20;
int & r=larger(x,y);
r=-1;
cout<<x<<endl<<y<<endl;
}
Introduction to C++ 17

int & larger(int & a, int & b)


{
if(a>b) //return a reference to the larger parameter
return a;
else
return b;
}
/*End of reference04.cpp*/

Output
10
–1

In the foregoing listing, ‘a’ and ‘x’ refer to the same memory location while ‘b’ and ‘y’
refer to the same memory location. From the larger() function, a reference to ‘b’, that is,
reference to ‘y’ is returned and stored in a reference variable ‘r’. The larger() function does
not return the value ‘b’ because the return type is int& and not int. Thus, the address of ‘r’
becomes equal to the address of ‘y’. Consequently, any change in the value of ‘r’ also changes
the value of ‘y’. Listing 1.19 can be shortened as illustrated in Listing 1.20.

Listing 1.20 Returning by reference

/*Beginning of reference05.cpp*/
#include<iostream.h>
int & larger(int &, int &);
int main()
{
int x,y;
x=10;
y=20;
larger(x,y)=-1;
cout<<x<<endl<<y<<endl;
}
int & larger(int & a, int & b)
{
if(a>b) //return a reference to the larger parameter
return a;
else
return b;
}
/*End of reference05.cpp*/

Output
10
–1

The name of a non-constant variable can be placed on the left of the assignment operator
because a valid address—the address of the variable—can be determined from it. A call to
a function that returns by reference can be placed on the left of the assignment operator for
the same reason.
If the compiler ¿nds the name of a non-constant variable on the left of the assignment
operator in the source code, it writes instructions in the executable to
x determine the address of the variable,
x transfer control to the byte that has that address, and
18 Object-Oriented Programming with C++

x write the value on the right of the assignment operator into the block that begins with
the byte found above.
A function that returns by reference primarily returns the address of the returned variable.
If the call is found on the left of the assignment operator, the compiler writes necessary
instructions in the executable to
x transfer control to the byte whose address is returned by the function and
x write the value on the right of the assignment operator into the block that begins with
the byte found above.
The name of a variable can be placed on the right of the assignment operator. A call to
a function that returns by reference can be placed on the right of the assignment operator
for the same reason.
If the compiler ¿nds the name of a variable on the right of the assignment operator in the
source code, it writes instructions in the executable to
x determine the address of the variable,
x transfer control to the byte that has that address,
x read the value from the block that begins with the byte found above, and
x push the read value into the stack.
A function that returns by reference primarily returns the address of the returned variable.
If the call is found on the right of the assignment operator, the compiler writes necessary
instructions in the executable to
x transfer control to the byte whose address is returned by the function,
x read the value from the block that begins with the byte found above, and
x push the read value into the stack.
A constant cannot be placed on the left of the assignment operator. This is because
constants do not have a valid address. Moreover, how can a constant be changed? Functions
that return by value, return the value of the returned variable, which is a constant. Therefore,
a call to a function that returns by value cannot be placed on the left of the assignment
operator.
You may notice that the formal arguments of the larger() function in the foregoing listing
have been declared as constant references because they are not supposed to change the values
of the passed parameters even accidentally.
We must avoid returning a reference to a local variable. For example, see Listing 1.21.

Listing 1.21 Returning the reference of a local variable

/*Beginning of reference06.cpp*/
#include<iostream.h>
int & abc();
void main()
{
abc()=-1;
}
int & abc()
{
int x;
return x; //returning reference of a local variable
}
/*End of reference06.cpp*/
Introduction to C++ 19

The problem with the above program is that when the abc() function terminates, ‘x’ will
go out of scope. Consequently, the statement
abc()=-1;
in the main() function will write ‘–1’ in an unallocated block of memory. This can lead to
run-time errors.

1.8 Function Prototyping


Function prototyping is necessary in C++. A prototype describes the function’s interface to
the compiler. It tells the compiler the return type of the function as well as the number, type,
and sequence of its formal arguments.
The general syntax of function prototype is as follows:
return_type function_name(argument_list);
For example,
int add(int, int);

This prototype indicates that the add() function returns a value of integer type and takes two
parameters both of integer type.
Since a function prototype is also a statement, a semicolon must follow it.
Providing names to the formal arguments in function prototypes is optional. Even if
such names are provided, they need not match those provided in the function de¿nition. For
example, see Listing 1.22.

Listing 1.22 Function prototyping

/*Beginning of funcProto.cpp*/
#include<iostream.h>
int add(int,int); //function prototype
void main()
{
int x,y,z;
cout<<“Enter a number: ”;
cin>>x;
cout<<“Enter another number: ”;
cin>>y;
z=add(x,y); //function call
cout<<z<<endl;
}
int add(int a,int b) //function definition
{
return (a+b);
}
/*End of funcProto.cpp*/

Output
Enter a number: 10<enter>
Enter another number: 20<enter>
30

Why is prototyping important? By making prototyping necessary, the compiler ensures


the following:
20 Object-Oriented Programming with C++

x The return value of a function is handled correctly.


x Correct number and type of arguments are passed to a function.
Let us discuss these points.
Consider the following statement in Listing 1.22:
int add(int, int);

The prototype tells the compiler that the add() function returns an integer-type value. Thus,
the compiler knows how many bytes have to be retrieved from the place where the add()
function is expected to write its return value and how these bytes are to be interpreted.
In the absence of prototypes, the compiler will have to assume the type of the returned
value. Suppose, it assumes that the type of the returned value is an integer. However, the
called function may return a value of an incompatible type (say a structure type). Now,
suppose an integer-type variable is equated to the call to a function where the function call
precedes the function de¿nition. In this situation, the compiler will report an error against
the function de¿nition and not the function call. This is because the function call abided by
its assumption, but the de¿nition did not. However, if the function de¿nition is in a different
¿le to be compiled separately, then no compile-time errors will arise. Instead, wrong results
will arise during run time as Listing 1.23 shows.

Listing 1.23 Absence of function prototype produces weird results

/*Beginning of def.c*/
/*function definition*/
struct abc
{
char a;
int b;
float c;
};
struct abc test()
{
struct abc a1;
a1.a=‘x’;
a1.b=10;
a1.c=1.1;
return a1;
}
/*End of def.c*/
/*Beginning of driver.c*/
void main()
{
int x;
x=test(); //no compile time error!!
printf(“%d”,x);
}
/*End of driver.c*/

Output
1688

A compiler that does not enforce prototyping will de¿nitely compile the above program.
But then it will have no way of knowing what type of value the test() function returns.
Introduction to C++ 21

Therefore, erroneous results will be obtained during run time as the output of Listing 1.23
clearly shows.
Since the C++ compiler necessitates function prototyping, it will report an error against
the function call because no prototype has been provided to resolve the function call. Again,
if the correct prototype is provided, the compiler will still report an error since this time the
function call does not match the prototype. The compiler will not be able to convert a struct
abc to an integer. Thus, function prototyping guarantees protection from errors arising out
of incorrect function calls.
What happens if the function prototype and the function call do not match? Such a situation
cannot arise. Both the function prototype and the function de¿nition are created by the same
person, that is, the library programmer. The library programmer puts the function’s prototype in
a header ¿le. He/she provides the function’s de¿nition in a library. The application programmer
includes the header ¿le in his/her application program ¿le in which the function is called. He/
she creates an object ¿le from this application program ¿le and links this object ¿le to the
library to get an executable ¿le.
The function’s prototype also tells the compiler that the add() function accepts two
parameters. If the program fails to provide such parameters, the prototype enables the compiler
to detect the error. A compiler that does not enforce function prototyping will compile a
function call in which an incorrect number and/or type of parameters have been passed. Run-
time errors will arise as in the foregoing case.
Finally, function prototyping produces automatic-type conversion wherever appropriate.
We take the case of compilers that do not enforce prototyping. Suppose, a function expects an
integer-type value (assuming integers occupy four bytes) but a value of double type (assuming
doubles occupy eight bytes) is wrongly passed. During run time, the value in only the ¿rst
four bytes of the passed eight bytes will be extracted. This is obviously undesirable. However,
the C++ compiler automatically converts the double-type value into an integer type. This
is because it inevitably encounters the function prototype before encountering the function
call and therefore knows that the function expects an integer-type value. However, it must
be remembered that such automatic-type conversions due to function prototypes occur only
when it makes sense. For example, the compiler will prevent an attempted conversion from
a structure type to integer type.
Nevertheless, can the same bene¿ts not be realized without prototyping? Is it not possible
for the compiler to simply scan the rest of the source code and ¿nd out how the function has
been de¿ned? There are two reasons why this solution is inappropriate. They are:
x It is inefficient. The compiler will have to suspend the compilation of the line containing
the function call and search the rest of the file.
x Most of the times the function definition is not contained in the file where it is called. It
is usually contained in a library.
Such compile-time checking for prototypes is known as static-type-checking.

1.9 Function Overloading


C++ allows two or more functions to have the same name. For this, however, they must have
different signatures. Signature of a function means the number, type, and sequence of formal
arguments of the function. In order to distinguish amongst the functions with the same name,
the compiler expects their signatures to be different. Depending upon the type of parameters
that are passed to the function call, the compiler decides which of the available de¿nitions
22 Object-Oriented Programming with C++

will be invoked. For this, function prototypes should be provided to the compiler for matching
the function calls. Accordingly, the linker, during link time, links the function call with the
correct function de¿nition. Listing 1.24 clari¿es this.

Listing 1.24 Function overloading

/*Beginning of funcOverload.cpp*/
#include<iostream.h>
int add(int,int); //first prototype
int add(int,int,int); //second prototype
void main()
{
int x,y;
x=add(10,20); //matches first prototype
y=add(30,40,50); //matches second prototype
cout<<x<<endl<<y<<endl;
}
int add(int a,int b)
{
return(a+b);
}
int add(int a,int b,int c)
{
return(a+b+c);
}
/*End of funcOverload.cpp*/

Output
30
120

Just like ordinary functions, the de¿nitions of overloaded functions are also put in libraries.
Moreover, the function prototypes are placed in header ¿les.
The two function prototypes at the beginning of the program tell the compiler the two
different ways in which the add() function can be called. When the compiler encounters the
two distinct calls to the add() function, it already has the prototypes to satisfy them both.
Thus, the compilation phase is completed successfully. During linking, the linker ¿nds the
two necessary de¿nitions of the add() function and, hence, links successfully to create the
executable ¿le.
The compiler decides which function is to be called based upon the number, type, and
sequence of parameters that are passed to the function call. When the compiler encounters
the ¿rst function call,
x=add(10,20);

it decides that the function that takes two integers as formal arguments is to be executed.
Accordingly, the linker then searches for the de¿nition of the add() function where there are
two integers as formal arguments.
Similarly, the second call to the add() function
y=add(30,40,50);

is also handled by the compiler and the linker.


Introduction to C++ 23

Note the importance of function prototyping. Since function prototyping is mandatory in


C++, it is possible for the compiler to support function overloading properly. The compiler
is able to not only restrict the number of ways in which a function can be called but also
support more than one way in which a function can be called. Function overloading is possible
because of the necessity to prototype functions.
By itself, function overloading is of little use. Instead of giving exactly the same name for
functions that perform similar tasks, it is always possible for us to give them similar names.
However, function overloading enables the C++ compiler to support another feature, that
is, function overriding (which in turn is not really a very useful thing by itself but forms the
basis for dynamic polymorphism—one of the most striking features of C++ that promotes
code reuse).
Function overloading is also known as function polymorphism because, just like
polymorphism in the real world where an entity exists in more than one form, the same
function name carries different meanings.
Function polymorphism is static in nature because the function de¿nition to be executed
is selected by the compiler during compile time itself. Thus, an overloaded function is said
to exhibit static polymorphism.

1.10 Default Values for Formal Arguments of Functions


It is possible to specify default values for some or all of the formal arguments of a function. If
no value is passed for an argument when the function is called, the default value speci¿ed for
it is passed. If parameters are passed in the normal fashion for such an argument, the default
value is ignored. Listing 1.25 is an illustrative example.

Listing 1.25 Default values for function arguments

/*Beginning of defaultArg.cpp*/
#include<iostream.h>
int add(int,int,int c=0); //third argument has default value
void main()
{
int x,y;
x=add(10,20,30); //default value ignored
y=add(40,50); //default value taken for the
//third parameter
cout<<x<<endl<<y<<endl;
}
int add(int a,int b,int c)
{
return (a+b+c);
}
/*End of defaultArg.cpp*/

Output
60
90

In the above listing, a default value—zero—has been speci¿ed for the third argument of the
add() function. In the absence of a value being passed to it, the compiler assigns the default
value. If a value is passed to it, the compiler assigns the passed value. In the ¿rst call
24 Object-Oriented Programming with C++

x=add(10,20,30);

the values of ‘a’, ‘b’, and ‘c’ are 10, 20, and 30, respectively. But, in the second function call
y=add(40,50);

the values of ‘a’, ‘b’, and ‘c’ are 10, 20, and 0, respectively. The default value—zero—for
the third parameter ‘c’ is taken. This explains the output of the above listing.
Default values can be assigned to more than one argument. Listing 1.26 illustrates this.

Listing 1.26 Default values for more than one argument

/*Beginning of multDefaultArg.cpp*/
#include<iostream.h>
int add(int,int b=0,int c=0); //second and third arguments
//have default values
void main()
{
int x,y,z;
x=add(10,20,30); //all default values ignored
y=add(40,50); //default value taken for the
//third argument
z=add(60); //default value taken for
//the second and the third
//arguments
cout<<x<<endl<<y<<endl<<z<<endl;
}
int add(int a,int b,int c)
{
return (a+b+c);
}
/*End of multDefaultArg.cpp*/

Output
60
90
60

There is no need to provide names to the arguments taking default values in the function
prototypes.
int add(int,int=0,int=0);

can be written instead of


int add(int,int b=0,int c=0);

Default values must be supplied starting from the rightmost argument. Before supplying
default value to an argument, all arguments to its right must be given default values. Suppose
you write
int add(int,int=0,int);

you are attempting to give a default value to the second argument from the right without
specifying a default value for the argument on its right. The compiler will report an error that
the default value is missing (for the third argument).
Introduction to C++ 25

Default values must be speci¿ed in function prototypes alone. They should not be speci¿ed
in the function de¿nitions.
While compiling a function call, the compiler will de¿nitely have its prototype. Its de¿nition
will probably be located after the function call. It might be in the same ¿le, or it will be in a
different ¿le or library. Thus, to ensure a successful compilation of the function calls where
values for arguments having default values have not been passed, the compiler must be aware
of those default values. Hence, default values must be speci¿ed in the function prototype.
You must also remember that the function prototypes are placed in header ¿les. These are
included in both the library ¿les that contain the function’s de¿nition and the client program
¿les that contain calls to the functions. While compiling the library ¿le that contains the
function de¿nition, the compiler will obviously read the function prototype before it reads
the function de¿nition. Suppose the function de¿nition also contains default values for the
arguments. Even if the same default values are supplied for the same arguments, the compiler
will think that you are trying to supply two different default values for the same argument.
This is obviously unacceptable because the default value can be only one in number. Thus,
default values must be speci¿ed in the function prototypes and should not be speci¿ed again
in the function de¿nitions.
If default values are speci¿ed for the arguments of a function, the function behaves like
an overloaded function and, therefore, should be overloaded with care; otherwise ambiguity
errors might be caused. For example, if you prototype a function as follows:
int add(int,int,int=0);
int add(int,int);

This can confuse the compiler. If only two integers are passed as parameters to the function
call, both these prototypes will match. The compiler will not be able to decide with which
de¿nition the function call has to be resolved. This will lead to an ambiguity error.
Default values can be given to arguments of any data type as follows:
double hra(double,double=0.3);
void print(char=’a’);

1.11 Inline Functions


Inline functions are used to increase the speed of execution of the executable ¿les. C++ inserts
calls to the normal functions and the inline functions in different ways in an executable.
The executable program that is created after compiling the various source codes and linking
them consists of a set of machine language instructions. When a program is started, the
operating system loads these instructions into the computer’s memory. Thus, each instruction
has a particular memory address. The computer then goes through these instructions one by
one. If there are any instructions to branch out or loop, the control skips over instructions and
jumps backward or forward as needed. When a program reaches the function call instruction,
it stores the memory address of the instruction immediately following the function call. It then
jumps to the beginning of the function, whose address it ¿nds in the function call instruction
itself, executes the function code, and jumps back to the instruction whose address it had
saved earlier.
Obviously, an overhead is involved in
x making the control jump back and forth and
26 Object-Oriented Programming with C++

x storing the address of the instruction to which the control should jump after the function
terminates.
The C++ inline function provides a solution to this problem. An inline function is a function
whose compiled code is ‘in line’ with the rest of the program. That is, the compiler replaces
the function call with the corresponding function code. With inline code, the program does
not have to jump to another location to execute the code and then jump back. Inline functions,
thus, run a little faster than regular functions.
However, there is a trade-off between memory and speed. If an inline function is
called repeatedly, then multiple copies of the function definition appear in the code
(see Figures 1.1 and 1.2). Thus, the executable program itself becomes so large that it occupies
a lot of space in the computer’s memory during run time. Consequently, the program runs
slow instead of running fast. Thus, inline functions must be chosen with care.
For specifying an inline function, you must:
x prefix the definition of the function with the inline keyword and
x define the function before all functions that call it, that is, define it in the header file
itself.
The following listing illustrates the inline technique with the inline cube() function that
cubes its argument. Note that the entire de¿nition is in one line. That is not a necessary
condition. But if the de¿nition of a function does not ¿t in one line, the function is probably
a poor candidate for an inlne function!

Figure 1.1 Transfer of control in a non-inline function


Introduction to C++ 27

Figure 1.2 Control does not get transferred in an inline function

Listing 1.27 Inline functions

/*Beginning of inline.cpp*/
#include<iostream.h>
inline double cube(double x) { return x*x*x; }
void main()
{
double a,b;
double c=13.0;
a=cube(5.0);
b=cube(4.5+7.5);
cout<<a<<endl;
cout<<b<<endl;
cout<<cube(c++)<<endl;
cout<<c<<endl;
}
/*End of inline.cpp*/
28 Object-Oriented Programming with C++

Output
125
1728
2197
14

However, under some circumstances, the compiler, despite your indications, may not expand the
function inline. Instead, it will issue a warning that the function could not be expanded inline
and then compile all calls to such functions in the ordinary fashion. Those conditions are:
x The function is recursive.
x There are looping constructs in the function.
x There are static variables in the function.
Let us brieÀy compare macros in C and inline function in C++. Macros are a poor predecessor
to inline functions. For example, a macro for cubing a number is as follows:
#define CUBE(X) X*X*X

Here, a mere text substitution takes place with‘X’ being replaced by the macro parameter.
a=CUBE(5.0); //replaced by a=5.0*5.0*5.0;
b=CUBE(4.5+7.5); //replaced by
//b=4.5+7.5*4.5+7.5*4.5+7.5;
c=CUBE(x++); //replaced by c=x++*x++*x++;

Only the ¿rst statement works properly. An intelligent use of parentheses improves matters
slightly.
#define CUBE(X) ((X)*(X)*(X))

Even now, CUBE(c++) undesirably increments ‘c’ thrice. But the inline cube() function
evaluates ‘c’, passes the value to be cubed, and then correctly increments ‘c’ once.
It is advisable to use inline functions instead of macros.

Summary
Variables sometimes inÀuence each other’s values. be safe from unintentional modi¿cation by functions
A change in the value of one may necessitate a other than those de¿ned by him/her. Moreover, they do
corresponding adjustment in the value of another. It not guarantee a proper initialization of data members
is, therefore, necessary to pass these variables together of structure variables.
in a single group to functions. Structures enable us to Both of the above drawbacks are in direct
do this. contradiction with the characteristics possessed by
Structures are used to create new data types. This real-world objects. A real-world object has not only
is a two-step process. a perfect interface to manipulate its internal parts but
Step 1: Create the structure itself. also exclusive rights to do so. Consequently, a real-
world object never reaches an invalid state during its
Step 2: Create associated functions that work upon
lifetime. When we start operating a real-world object, it
variables of the structure.
automatically assumes a valid state. In object-oriented
While structures do fulfil the important need
programming systems (OOPS), we can incorporate
described above, they nevertheless have limitations.
these features of real-world objects into structure
They do not enable the library programmer to make
variables.
variables of the structure that he/she has designed to
Introduction to C++ 29

Inheritance allows a structure to inherit both data of the variable with which it is sharing memory. Calls
and functions of an existing structure. Polymorphism to functions that return by reference can be placed on
allows different functions to have the same name. It is the left of the assignment operator.
of two types: static and dynamic. Function prototyping is necessary in C++. Functions
Console output is achieved in C++ with the help can be overloaded. Functions with different signatures
of insertion operator and the cout object. Console can have the same name. A function argument can be
input is achieved in C++ with the help of extraction given a default value so that if no value is passed for it
operator and the cin object. in the function call, the default value is assigned to it.
In C++, variables can be de¿ned anywhere in a If a function is declared inline, its de¿nition replaces
function. A reference variable shares the same memory its call, thus, speeding up the execution of the resultant
location as the one of which it is a reference. Therefore, executable.
any change in its value automatically changes the value

Key Terms
creating new data types using structures - cin
lack of data security in structures - istream_withassign class
no guaranteed initialization of data in structures - extraction operator
procedure-oriented programming system - iostream.h header ¿le
object-oriented programming system - endl
data security in classes reference variable
guaranteed initialization of data in classes - passing by reference
inheritance - returning by reference
polymorphism importance of function prototyping
console input/output in C++ function overloading
- cout default values for function arguments
- ostream_withassign class inline functions
- insertion operator

Exercises
1. Which programming needs do structures ful¿ll? Why 10. State true or false.
does C language enable us to create structures? (a) Structures enable a programmer to secure the
2. What are the limitations of structures? data contained in structure variables from being
3. What is the procedure-oriented programming changed by unauthorized functions.
system? (b) The insertion operator is used for outputting
4. What is the object-oriented programming system? in C++.
5. Which class is ‘cout’ an object of? (c) The extraction operator is used for outputting
6. Which class is ‘cin’ an object of? in C++.
7. What bene¿ts does a programmer get if the compiler (d) A call to a function that returns by reference
forces him/her to prototype a function? cannot be placed on the left of the assignment
8. Why will an ambiguity error arise if a default value operator.
is given to an argument of an overloaded function? (e) An inline function cannot have a looping
9. Why should default values be given to function construct.
arguments in the function’s prototype and not in the 11. Think of some examples from your own experience in
function’s de¿nition? C programming where you felt the need for structures.
30 Object-Oriented Programming with C++

Do you see an opportunity for programming in OOPS on the left-hand side of the assignment operator.
in those examples? Experiment and ¿nd out whether such calls can be
12. Structures in C do not enable the library programmers chained. Consider the following:
to guarantee an initialization of data. Appreciate the
f(a, b) = g(c, d) = x;
implications of this limitation by taking the date
structure as an example. where ‘f’ and ‘g’ are functions that return by reference
13. Calls to functions that return by reference can be put while ‘a’, ‘b’, ‘c’, ‘d’, and ‘x’ are variables.
2 Classes and Objects

The previous chapter refreshed the reader’s knowledge of the structure construct provided
by C language—its use and usage. It also dealt with a critical analysis of structures along with
their pitfalls and limitations. The reader was made aware of a strong need for data security and
for a guaranteed initialization of data that structures do not provide.
This chapter is a logical continuation to the previous one. It begins with a thorough
explanation of the class construct of C++ and the ways by which it ful¿ls the above-mentioned
O needs. Superiority of the class construct of C++ over the structure construct of C language is
emphasized in this chapter.
V This chapter also deals with how classes enable the library programmer to provide exclusive
E rights to the associated functions.
A description of various types and features of member functions and member data ¿nds a
R prominent place in this chapter. This description covers:
x Overloaded member functions
V
x Default values for the arguments of member functions
I x Inline member functions
x Constant member functions
E x Mutable data members
W x Friend functions and friend classes
x Static members
A section in this chapter is devoted to namespaces. They enable the C++ programmer to
prevent pollution of the global namespace that leads to name clashes.
Example code to tackle arrays of objects and arrays inside objects form the penultimate
portion of this chapter.
The chapter ends with an essay on nested classes—their need and use.

2.1 Introduction to Classes and Objects


Classes are to C++ what structures are to C. Both provide the library programmer a means
to create new data types.
Let us brieÀy recapitulate the issues faced while programming in C described in the previous
chapter. In C, the library programmer creates structures. He/she also provides a set of tested
bug-free functions that correctly manipulate the data members of structure variables.
The Date structure and its accompanying functions may be perfect. However, there is
absolutely no guarantee that the client programs will use only these functions to manipulate
the members of variables of the structure. See Listing 2.1.
Another Random Scribd Document
with Unrelated Content
denn die Reichsgesetze hatte man entweder im stillen beseitigt oder sie
waren gar, wie in Holstein, wo die dänische Pressfreiheit eingeführt war,
offiziell abgeschafft. Auch in Mecklenburg, Braunschweig, Weimar, Hessen-
Darmstadt, Nassau bestand faktisch Pressfreiheit, ohne dass sie rechtlich
garantiert war. In Hannover waren wenigstens die Werke der Professoren
der Universität Göttingen zensurfrei. In Baden, Dessau und den freien
Reichsstädten, namentlich in Hamburg, fand die Tagespresse in der Regel
eine sichere Zufluchtsstätte. Am traurigsten sah es in Bayern aus. Bayern
Nach einem kurzen Lichtblick unter der Regierung des Kurfürsten .
Maximilian III. Joseph war ein ganz massloser Druck eingetreten, Württe
und auch in Württemberg wurde grosse Härte und Willkür geübt. mberg.
Es kam dort zu Vorgängen — wie gegen den Dichter Schubart —, die sich
denen der Säbelherrschaft Napoleons nicht unwürdig anreihen.
In den geistlichen Staaten unterlagen die Presserzeugnisse Die
neben der weltlichen Zensur auch noch der des römischen geistliche
n
Stuhles und es kamen öfters Fälle vor, dass Schriften auf Befehl Staaten.
Roms nachträglich konfisziert wurden, nachdem sie bereits die
Landeszensur passiert hatten.
Sachsen, obwohl der Hauptsitz des Buchhandels, war nicht, Sachsen.
wie man es wohl hätte erwarten können, geneigt, zu freisinnigen
Pressinstitutionen die Initiative zu ergreifen, um damit Leipzig auch zum
Zentrum der wissenschaftlichen Bewegung und der Tagespresse zu
machen, wie es der Mittelpunkt des bibliopolischen Verkehrs geworden
war. Es fehlte sowohl bei der Regierung wie bei dem Volke der eigentliche
Schwung. Schon die Religionsverschiedenheit der Herrscher und des
Volkes legte der freien Behandlung religiöser Fragen Hindernisse in den
Weg. War man jedoch auch nicht freisinnig in der Gesetzgebung, so war
man doch in der Praxis mild und suchte den Buchhandel auf Grund von
Leipzigs Stellung zu demselben möglichst zu schonen[154]. Die
Bücherkommission, zu welcher die Regierung Mitglieder der Universität,
des Rats und später des Buchhandels ernannte, verfuhr mit grösster
Schonung, nur über einen, den strengen Zensor Bel, war man sehr
missgestimmt; ja es kam so weit, dass man von dem Wegbleiben der
Auswärtigen von der Messe sprach.
Mit dem Beginn der vorliegenden Periode beginnt auch das Die
Aufblühen der nationalen Litteratur, die zu Ende des XVIII. und nationale
Litteratur.
zu Beginn des XIX. Jahrhunderts ihre schönsten Blüten trieb. Zu
der Zeitungslitteratur, welche sich mit Besprechung oder Kritik Zeitschrift
der öffentlichen Zustände beschäftigte, gab erst A. L. v. Schlözer en.
in Göttingen, dem K. F. v. Moser nacheiferte, den Anstoss. Schlözers
Staatsanzeigen 1782–1793 hatten zurzeit 4000 Abnehmer und waren
selbst in den höchsten Kreisen beachtet. Von da ab wurden alle Der
Verhältnisse in den Wochen- und namentlich in den Buchhand
el.
Monatsschriften erörtert und um 1785 gab es 400–500
Zeitschriften. Die politische Tagesschriftstellerei war damals noch nicht ein
förmliches Gewerbe, die Unternehmer waren meist Professoren und
Gelehrte, die Bücherkäufer bestanden hauptsächlich nur aus Gelehrten,
Bibliotheken und Beamten, deren begrenzte Mittel sie jedoch gewöhnlich
zwangen, sich auf das Nötigste zu beschränken. Das übrige Publikum
begnügte sich nicht selten mit fader Unterhaltungslitteratur. Ein direktes
Eingreifen des Buchhandels, um neue litterarische Erscheinungen
hervorzurufen, war nur selten bemerkbar, der buchhändlerische
Unternehmungsgeist war noch nicht erwacht.
Erst mit Friedr. Arnold Brockhaus beginnt das eigentliche tendenziöse
Eingreifen der Verleger, welche die Verbreitung wirklicher allgemeiner und
politischer Bildung ins Auge fassten. Aber welche Quelle der Sorgen und
Plagen sollten ihm und seinen Gesinnungsgenossen aus solchem Beginnen
erwachsen[155]!
Eine Reform des buchhändlerischen Geschäftsbetriebes war Reform
schon in der letzten Hälfte des XVIII. Jahrhunderts versucht des
Buchhand
worden, namentlich richteten sich die Bestrebungen auf die els.
Unterdrückung des Nachdrucks und auf Gleichmässigkeit und
Ordnung in den Rechnungsverhältnissen. Ph. E. Reich in Leipzig gelang es
1765, den ersten Buchhändler-Verein zustande zu bringen, doch war die
Wirksamkeit desselben keine grosse und er verschwand bald ganz. 1792
versuchte P. G. Kummer in Leipzig wieder einen solchen zu begründen,
jedoch erst der durch C. C. Horvath aus Potsdam hervorgerufene
Börsenverein[156] war von Dauer und aus ihm entstand 1824 erst der
wirkliche, jetzt noch bestehende Börsenverein der Deutschen Buchhändler,
dem es namentlich durch die unermüdlichen Anstrengungen des 1833 am
25. Februar gegründeten Leipziger Buchhändler-Vereins und durch die
liberale Unterstützung der Sächsischen Regierung gelang, am 1. Mai 1836
sich in dem eigenen stattlichen Börsengebäude versammeln zu können.
Seit der Zeit ist der Verein ruhig fortgeschritten und zählte Börsenver
1882 1480 Mitglieder. Sein Haus besitzt er seit 1869 vollständig ein.

schuldenfrei; ausserdem eine höchst wertvolle, in ihrer Art einzig


dastehende Fachbibliothek und reiche Sammlungen für die Geschichte der
graphischen Künste[157], einen Verlag fachgeschichtlicher Schriften, ein
wohlgeordnetes Finanzwesen und ein Vermögen von nahe an 400000
Mark.
Ein wesentlicher Einfluss auf die Gesetzgebung über das litterarische
Eigentumsrecht und auf die Ordnung der Verhältnisse der Presse ist dem
Verein durch das Vertrauen der Regierungen zugefallen. Einige in letzter
Zeit in seinem Schosse entstandene Differenzen, die aus den Versuchen
entsprangen, dem Verein Machtbefugnisse beizulegen, die ihn berechtigt
haben würden, in geschäftliche Verhältnisse des Einzelnen einzugreifen,
waren nicht derart, um für den so fest begründeten nützlichen Verein
Gefahren zu bereiten.
Das Vereinsorgan ist das 1834 gegründete, seit 1867 täglich
erscheinende „Börsenblatt für den deutschen Buchhandel“[158]; dieses im
Verein mit dem „Naumburgschen Wahlzettel“, „Schulz' Adressbuch für den
deutschen Buchhandel“ und dem „Hinrichsschen Bücherverzeichnisse“ sind
geschäftliche Hülfsmittel von grossem Werte, wie sie in dieser Ausdehnung
keine andere buchhändlerische Organisation besitzt[159].

Fast gleichzeitig mit der Gründung des Börsenvereins und des Aufschwu
Leipziger Buchhändler-Vereins war die grosse politische ng der
Pressgew
Bewegung infolge der Julirevolution in Paris 1830 und die erbe.
bedeutenden technischen Verbesserungen der Typographie
eingetreten. Die Produktion kam nun rasch in Fluss und trat in mancher
Beziehung in andere Bahnen ein. War der Buchhändler früher weniger ein
Spekulant gewesen, so wurde er jetzt vielfach ein Bücherfabrikant und
unterlag als solcher mehr als sonst den Schwankungen der
Zeitverhältnisse[160].
Die Zeitschriften, selbst die belletristischen, schlugen unter Die
Führung des jungen Deutschlands mehr oder weniger eine illustrierte
n Blätter.
tendenziös-politische Richtung ein. Daneben wucherte die
Broschürenlitteratur in üppigster Fülle.
Geradezu umwälzend wirkte 1832 das Erscheinen des Penny magazine
(S. 94) auf die deutsche Journallitteratur. Es entstanden die
verschiedensten Nachahmungen und selbst die Verleger der
nichtillustrierten Blätter waren wenigstens bemüht, diese durch
Bilderprämien, zuerst Stahlstiche und schwarze Lithographien, später
Chromolithographien, unter Zuhülfenahme der Colportage „bis in die
Hütten“ zu verbreiten. Den Pfennigblättern folgte 1843 die „Illustrierte
Zeitung“. Auch der Humor machte unter Vortritt der „Fliegenden Blätter“
(1845) seine Rechte in einer Reihe von periodischen Schriften geltend, in
welchen hauptsächlich die lithographische Federzeichnung, bei welcher
der Künstler ohne die Dazwischenkunft eines Anderen seiner Laune die
Zügel schiessen lassen konnte, Verwendung fand.
Im Gefolge der illustrierten Blätter und unterstützt durch die Die
grossen Fortschritte der Holzschneidekunst stellten sich die Kalenderli
tteratur.
zahlreichen Volkskalender ein, von denen der von Fr. W. Gubitz
(1833) herausgegebene der reichste an Inhalt sowie an Illustrationen,
zugleich der am weitesten verbreitete war. Leider wurde dieser
volkstümlichsten und bei ehrlichem Streben sehr beachtenswerten
Gattung von Presserzeugnissen nicht allein durch die Höhe der
daraufgelegten Stempelsteuer, sondern noch mehr durch die mit der
Erhebung derselben in der Zeit der Vielstaaterei und der ausgebildetsten
Zollplackerei verbundenen Schwierigkeiten sehr gehemmt und den
Verlegern eine Quelle des fortwährenden Verdrusses und Nachteils
eröffnet.
Die Illustration bemächtigte sich jedoch nicht nur der Die
Journallitteratur, sondern es entstanden auch illustrierte illustrierte
n
Lieferungswerke in grosser Zahl, welche bei der Heftwerk
Erscheinungsweise in Heften zu 2½, 5 oder höchstens 10 e.
Groschen leicht Eingang fanden, bis Missbrauch der Geduld und
der Kasse des Publikums sie in Misskredit brachte.
Den Reigen begannen Werke mit lithographischen, zumteil kolorierten
Bildern, dann folgten solche mit Stahlstichen, Holzschnitten und
Chromolithographien. Leipzig und Stuttgart gaben den Ton an. Österreich
blieb in der Produktion zurück, bildete aber das vorzüglichste
Absatzgebiet. Für Holzschnittwerke wurden zuerst namentlich französische
Clichés benutzt; bald aber konnte Deutschland Originale genug liefern und
gab bereits im Jahre der Jubelfeier von Gutenbergs Kunst vollgültige
Beweise seines selbständigen Schaffens. Die Stahlstichwerke wurden
hauptsächlich mit englischen Produkten illustriert; dann wagte man sich
daran, unter Beihülfe englischer Künstler, von denen viele sich in
Deutschland etablierten, die Stiche selbst zu liefern.
An die Stelle der Taschenbücher in bescheidenem Format traten nach
englischen Mustern die grossen Albums und Jahrbücher, die sich jedoch eben
so wenig in Deutschland wie in England hielten und den illustrierten
Dichterwerken Platz machten.
Ebenfalls eine andere von England nach Deutschland Die
verpflanzte, jedoch sehr schnell verschwindende Mode war die Klassiker-
Ausgaben
der Klassiker-Ausgaben in einem Bande grossen Formats mit .
gespaltenen Kolumnen. Dahingegen fanden die sogenannten
Schiller-Ausgaben (von 1845 ab) in einem kleinen breiten Sedez eine grosse
Verbreitung und andauernden Beifall. Jeder Verleger spürte in seinem
Verlagskataloge eifrigst nach, ob er nicht einen von ihm übersehenen
„Klassiker“ im Verlage habe und mancher wunderbare Klassiker-Heilige
zeigte sich mit der Schillerkutte angethan. Selbst umfangreichere
wissenschaftliche Werke fielen der Schillerformat-Manie anheim. Für die
epochemachende Tauchnitz-Collection war dies Format bereits 1842
angenommen.
Die Bedürfnisse nach allgemeinen encyklopädischen Konversat
Kenntnissen fanden reiche Nahrung durch die grosse Zahl von ionslexika
.
Konversationslexika mit oder ohne Illustrationen, die alle mehr
oder weniger in Brockhaus' Kielwasser mit einer von ihm in billigster Weise
entlehnten Ladung segelten. Sogar die Damen erhielten ein solches
Lexikon und es fehlte auch nicht einmal eins für Kinder.
Die Zensurplackereien in den Jahren 1830–1848 überschritten alle
Grenzen. Zwar waren Schriften über 20 Bogen zensurfrei geworden,
jedoch musste 24 Stunden vor der Herausgabe ein Exemplar der Polizei
überreicht werden, und diese Zeit genügte für die provisorische
Beschlagnahme, die in ihren Wirkungen für den Verleger einer Die
definitiven ziemlich gleichkam. Für die politische Poesie und den politische
Poesie.
politischen und sozialen Roman lag hierin ein Vorschub, da
diesen Erzeugnissen nicht so leicht beizukommen war als denjenigen eines
klar ausgesprochenen politischen Inhalts. Der Unterdrückte wird durch
strenge Massregeln seiner Überwacher nur erfinderischer in der Auswahl
seiner Mittel, diese zu umgehen, und die erwähnten Litteraturzweige
blühten.
So hatte es lange unter der Asche geglimmt, bevor der Brand Pressfreih
infolge der Pariser Februar-Revolution 1848 in Deutschland in eit.

hellen Flammen sich Luft machte. Eine Folge war die endliche Gewährung
der seit mehr als 30 Jahren verheissenen Pressfreiheit und die
unbehelligte Einfuhr der Bücher in Österreich, bei welcher jedoch der
Buchhandel pekuniär vorläufig wenig gewann, da der Reiz des Besitzes
des Verbotenen nunmehr aufhörte.
Für die erste Zeit nahmen Zeitungen und Broschüren[161] die Die
Zeitungen
Aufmerksamkeit des Publikums ausschliesslich in Anspruch. Viele und
Kontinuationswerke kamen ins Stocken; der Kredit des Broschüre
Buchhandels wurde beschnitten. Nur in der Zeitungslitteratur n.
herrschte frisches Leben, aber auch eine grosse Zersplitterung der Kräfte,
unter welcher die Erzielung grosser Resultate sehr schwer war. Jede
Parteischattierung, jede Stadt, jedes Städtchen wollte ein Blatt oder
Blättchen für sich haben.
Während die politischen Zeitungen mit ihren reichhaltigen litterarischen
und schönwissenschaftlichen Feuilletons die eigentliche
Unterhaltungslitteratur und auch die litterarischen Blätter ganz
zurückdrängten, gediehen die illustrierten, halb unterhaltenden, halb
belehrenden Wochenblätter, für welche die „Gartenlaube“ die
Bahnbrecherin gewesen war, vortrefflich.
Als ein bedeutendes Element trat die Mode hinzu. Die grossen Modezeit
Muster- und Modezeitungen, welchen zurseite die Frauen ungen.
standen, die zum Schrecken der Männer alles Mögliche und Unmögliche
behäkelten oder bestickten und in „Schnitten“ das Unglaublichste
leisteten, fanden eine mitunter kolossale Verbreitung und wurden selbst in
Paris massgebend.
Auch die politisch-soziale Satire hatte ihren Tummelplatz, auf welchem
der „Kladderadatsch“ sich als Vorturner auszeichnete.
Nachdem die Regierungen nach der Sturmperiode sich von Die
ihrem Schrecken erholt und wieder festeren Boden unter sich Reaktion.
fühlten, begann die Reaktion erst im stillen, dann offen ihr Spiel zu treiben
und die Verfolgungen gegen Schriftsteller, Verleger und Drucker gehörten
zur Tagesordnung. Von allen Seiten trat die Politikmüdigkeit ein, dagegen
stieg die Lust an Büchern in demselben Verhältnis wie die Unlust an
Zeitungen. Die Konkurrenz im Buchhandel erhob sich wieder mächtig.
Sprach jemand einen Gedanken aus, so fiel gleich ein halbes oder ganzes
Dutzend Verleger über denselben her und zeigte sich bereit, an der
Abhülfe eines längst gefühlten Bedürfnisses mitzuwirken. Die Die
Kollektiv-Unternehmungen aller Art schossen wie Pilze aus der Erde Kollektiv-
Unterneh
und fanden guten Absatz, mit Ausnahme der men.
Romansammlungen, denn trotz der Billigkeit und der zumteil
guten Auswahl derselben zog das Publikum doch vor, sich mit der schönen
Litteratur durch die Zahlung von fünf Pfennigen oder einem Groschen
Leihgebühren pro Band abzufinden.
Durch die Eisenbahnen war die Welt in eine fortwährende Bewegung
gekommen. Es musste also auch für die Bedürfnisse des reisenden
Publikums gesorgt werden, was in ergiebigster Weise durch
Reisehandbücher und Reiseatlanten, Parleurs etc. geschah.
Ein Tag von grosser Bedeutung in der Geschichte des Der 9.
Buchgewerbes war der 9. November 1867, an welchem die Novembe
r 1867.
Verlagsrechte an die Werke der seit 30 Jahren oder länger
verstorbenen Autoren Gemeingut wurden. Merkwürdigerweise hatten die
hauptsächlichsten Verleger der Werke, die von der Bestimmung getroffen
wurden, nicht versucht, der Gefahr beizeiten energisch zu begegnen, und
überliessen den Konkurrierenden eine zeitlang das Feld. Diese hatten aber
um so vorsorglicher gehandelt und sich zumteil vor Ablauf des Termins mit
einigen Verlegern geeinigt, sodass sie noch vor dem 9. November ihre
Kollektionen zu den wohlfeilsten Preisen beginnen konnten. Fast noch
einschneidender als im Buchhandel wirkte dieser Tag in dem
Musikalienhandel.
Neben den besseren Erzeugnissen der Unterhaltungs-Litteratur Der
florierte die Schmarotzer-Pflanze des Colportage-Romans und Colportag
e-Roman.
tötete teilweise den Sinn für ernstere Lektüre, brachte auch
nebenbei durch Beigabe grösstenteils mittelmässiger Prämienbilder die
jugendlich frisch aufblühende Kunst des Farbendruckes in Misskredit.
Die grossen Fortschritte der Typographie, der Xylographie und Die
der Chromolithographie in Verbindung mit der Photographie und Pracht-
Albums.
den verschiedenen Lichtdruckverfahren hatten den Geschmack
für schöne Bücher mächtig gefördert und riefen ARCHITEKTONISCHE und
technischeWerke von grossem Werte, sowie Mustersammlungen der besseren
Erzeugnisse alter, mittlerer und neuerer Zeit hervor. Es folgten prachtvolle
ethnographische Werke. Schliesslich entstand eine wahre Sintflut von
Albums, hauptsächlich mit photographischen Illustrationen zu Gedichten,
Romanen, Opern u. dgl.
Als jüngste Phase des Buchhandels, deren Resultate noch nicht Die
vorliegen können, müssen die Mark-bibliotheken bezeichnet „Mark-
Bibliothek
werden, in welchen ein hübsch gebundener Band für eine Mark en“.
geliefert wird. Diese Kollektionen beschränken sich nicht auf die
Unterhaltungs-Litteratur, sondern dehnen sich auch auf die
wissenschaftliche aus.
Zum Schluss sei noch die Landkarten-Produktion erwähnt. Diese Die
erhielt durch Hülfe der Chemitypie und der Zinkographie, sowie Landkarte
n-
der Vielfarben-Druckmaschine eine gewaltige Ausdehnung und Produktio
die Billigkeit der Erzeugnisse bei schöner Ausführung grenzt an n.
das Wunderbare. Da diese Branche der Aufklärung ohne jeden
bitteren Beigeschmack dient, so kann die Freude hierüber eine ungetrübte
sein.

Unter den Errungenschaften des Jahres 1848 war auch das Buchdruc
Associationsrecht. Es war selbstverständlich, dass die ker-
Gehülfen-
Buchdrucker-gehülfen dasselbe benutzten, um sich in Vereine zu Verband.
sammeln behufs Vertretung ihrer Interessen mit gemeinsamen
Kräften. Dass sie mässiger in der Benutzung ihrer Freiheiten hätten sein
sollen als alle anderen Klassen, war nicht zu verlangen. Die alte
„patriarchalische“ Zeit hatte ihnen durch willkürliche Berechnungs- und
unregelmässige Zahlungsweise manche Unbill gebracht, für welche sie
jetzt Revanche nahmen, dabei die Berechnung der Zinsen nicht
vergessend.
Eine erste allgemeine Versammlung der Gehülfen aus ganz Deutschland
fand in den Tagen vom 11. bis 14. Juni 1848 in Mainz statt. Die dort
gefassten Beschlüsse hatten zwar einen Protest von gegen 200 Prinzipalen
zur Folge, dabei blieb es jedoch und man liess den Verband der
Buchdrucker- und Schriftgiesser-Gehülfen, welcher die lebhafteste
Beteiligung fand, ruhig gewähren.
Erst nachdem der Verband fast unumschränkter Herr in den Der
Druckereien geworden, dachten die Prinzipale daran, sich auch Prinzipal-
Verein.
an einander zu schliessen und versammelten sich am 15. August
1869 ebenfalls in Mainz. Der dort konstituierte Verein wollte nicht nur
Front gegen den Gehülfen-Verein machen und die persönlichen
Beziehungen fördern und kräftigen, sondern auch in der Art des
Börsenvereins der deutschen Buchhändler die Interessen des Geschäfts in
allen Lagen vertreten. Zum Vorort wurde Leipzig bestimmt und ein
Vorstand von neun Mitgliedern gewählt. 1872 zählte der Prinzipal-Verein
mehr als 700 Mitglieder; der Gehülfen-Verband das Zehnfache (7295). Die
Gesamtzahl der Gehülfen mochte gegen 11000 betragen. Von den etwa
4000 Nichtverbandsmitgliedern hielt sich eine ziemliche Anzahl nur als
„Schlaumeier“ von den Verbandsbestrebungen zurück; im Herzen gönnten
sie selbstverständlich, wenn sie auch nicht immer das Vorgehen des
Verbandes im einzelnen billigten, wohl so ziemlich alle dem Verband die
grösstmöglichsten Vorteile, denn auch sie genossen ja in ihrer gedeckten
Position die errungenen Vorteile mit.
Nach einer langen Reihe von Differenzen und nach zahlreichen Differenz
Übergriffen seitens des Verbandes fand zu Anfang des Jahres en
zwischen
1873 eine allgemeine Kündigung der Gehülfen seitens der Prinzipalit
Prinzipale statt. Da jedoch nicht alle Druckereien dem Verein ät und
angehörten, denn auch unter den Prinzipalen gab es viele Gehülfens
chaft.
„Schlaumeier“, und ein grosser Teil der Mitglieder den gefassten
Beschlüssen nicht treu blieb, kam es nach vielen Verhandlungen zwischen
den beiden Vereinen am 12. Januar 1874 zu einem Abkommen, das mit
einem allgemein einzuführenden Tarif und dem Einsetzen eines
Einigungsamtes in Differenzfällen endigte.
Der Prinzipal-Verein hat seinen Zweck bis jetzt nur im beschränkten
Masse erreicht, weil er zu viel in einer zu kurzen Zeit erreichen wollte und
weil manche seiner Mitglieder direkte Hülfe in ihren besonderen
Angelegenheiten vom Verein erwarteten, während dieser nur für eine
Anbahnung besserer Zustände im allgemeinen wirksam sein konnte. Jetzt,
wo er seiner Thätigkeit engere Grenzen gesteckt hat, ist auch zu erwarten,
dass er, wennauch nur Schritt für Schritt, zum Ziel gelangen wird, um so
mehr, als die Gehülfen ihre prinzipielle Opposition gegen ihn aufgegeben
haben[162].
Die offenbar zu grossen Einräumungen der Prinzipale im Jahre 1874
sind durch die Praxis gemildert, denn auch die Gehülfen haben einsehen
gelernt, dass es im Geschäft gewisse Grenzen giebt, die man ohne sich
selbst zu schädigen nicht überschreiten kann.
So hat die beste Lehrmeisterin, die Erfahrung, am meisten Ruhigere
dazu beigetragen, das Verhältnis im allgemeinen befriedigender Verhältnis
se.
zu gestalten. Die Versuche der Gehülfen, kooperative Druckereien
zu begründen, haben aus den jedem Geschäftsmann leicht erklärlichen
Gründen fast nur Misserfolge gehabt. Diese Thatsache hat ebenfalls
gedient, die Gehülfen darüber aufzuklären, dass auch im Geschäft nicht
alles Gold ist, was glänzt, und sie mit dem Los der Abhängigkeit zu
versöhnen. Somit steht zu hoffen, dass künftig ein innigeres
Zusammenwirken von Prinzipalität und Gehülfenschaft dazu beitragen
wird, Gutenbergs Kunst stets mehr und mehr zu Ehren zu bringen.
Das bedeutendste Organ der Gehülfenschaft ist der, jetzt Die
dreimal wöchentlich erscheinende, 1862 gegründete Organe
der
„Correspondent für Deutschlands Buchdrucker und Gehülfens
Schriftgiesser“. Früher fast nur und oft in massloser Weise chaft.
polemisch wirkend, ist das Blatt mit den Verhältnissen auch
ruhiger geworden, bringt jetzt manche technische und belehrende Artikel
und hat namentlich um statistische Aufnahmen Verdienste. Der Leiter ist
seit einer langen Reihe von Jahren Richard Härtel, der, früher zugleich
Präsident des Verbandes, mit Klugheit und Geschick die Interessen
desselben wahrgenommen hat. Das Organ der österreichischen Gehülfen
ist „Vorwärts“ in Wien.

Es erübrigt noch, einen kurzen Überblick über die Kräfte, Statistisc


welche bei der graphischen Produktion in Deutschland wirken, hes.

und über die Produktion selbst zu geben.


Das Deutsche Reich hatte 1881 in 1471 Städten 3389 Buch- u.
Steindruc
Buchdruckereien und 1994 Steindruckereien[163]. In diesen kereien.
Offizinen sind 96 Rotationsmaschinen, 5811 typographische,
1369 lithographische Schnellpressen, 244 Tretmaschinen, 2463
typographische und 6687 lithographische Handpressen vorhanden. Jedoch
darf nicht übersehen werden, dass der grösste Teil der typographischen
Handpressen entweder nur als Korrekturpressen dienen oder auch ein
vollständiges Stillleben führen. Beschäftigung fanden (1875) 52000
männliche, 11600 weibliche Mitarbeiter und 8400 Lehrlinge, in Summa
also 71000 Arbeiter.
Von Schriftgiessereien waren 342 mit 2588 Arbeitern, von
Schriftschneidereien und xylographischen Anstalten 371 mit 2353
Personen vorhanden. Von 66 Spielkartenfabriken wurden jährlich gegen
4500000 Pakete geliefert, auf denen Abgaben von etwa 1200000 Mark
ruhten.
Von Buch- und Kunsthandlungen gab es in 987 Städten 4376 Buch- u.
mit 10590 Mitarbeitern. 11251 Buchbindereien beschäftigten Kunsthan
dlungen.
31624 Personen (darunter 7055 weibliche). Leihbibliotheken gab
es 455, Zeitungs- und Annoncen-Expeditionen 326, Öldruck- und Globen-
Anstalten 342.
Im Jahre 1882 lieferten 1432 Städte 4998 Zeitschriften, von Zeitschrift
denen 76 in nichtdeutscher Sprache. Unter diesen vielen en.

Zeitungen wurzeln bloss 9 in dem XVII., 89 in dem XVIII. Jahrhundert.


Über 4000 entstanden seit 1830, von denen wieder über 2000 in den
letzten zehn Jahren verschwanden, um wieder anderen Raum zu
gewähren. Von den Zeitschriften kamen 2435 auf Preussen, 515 auf
Bayern, 504 auf Sachsen, 216 auf Württemberg. Der Hauptvertrieb fällt
der Post zu. Die Versendung betrug im Jahre 1880 gegen 300 Millionen
Nummern.
Die Bücherproduktion des gesamten deutschen Buchhandels Die
(also nicht nur des Deutschen Reiches) betrug 1879 14179 Bücherpr
oduktion.
Nummern, 1880 14941 Nummern, 1881 15191 Nummern, und
findet in ähnlicher Weise seit langer Zeit eine fortwährende Steigerung
statt. In betreff der Ausfuhr deutscher Bücher ist Nordamerika für diese
der bedeutendste Markt, auf welchem jährlich etwa für zwei Millionen
Mark abgesetzt wird.
Zum Vergleich mit dem (S. 224) gegebenen Verzeichnis, aus welchem
hervorgeht, dass 26 Städte Frankreichs von mehr als je 50000 Einwohnern
zusammen eine Bevölkerung von 2594100 Seelen, 343 Buchdruckereien,
390 lithographische Anstalten, 908 Buchhandlungen und 640 Zeitschriften
haben, folgt umstehend eine ähnliche Aufstellung aus dem Deutschen
Reiche.
Das Deutsche Reich hat demnach in 42 Städten mit über je 50000
Einwohnern und einer Gesamteinwohnerzahl von 4176000 Seelen 966
Buchdruckereien, 888 lithographische Anstalten, 1737 Buchhandlungen,
1153 Zeitschriften. Nehmen wir zu einem näheren Vergleich die 26 ersten
Städte des Deutschen Reichs (von Berlin abgesehen) und stellen sie gegen
die 26 Städte Frankreichs, so finden wir, dass erstere 3286000 Einwohner,
769 Buchdruckereien, 730 lithographische Anstalten, 1478
Buchhandlungen, 961 Zeitschriften haben; also gegen letztere ein Mehr
von 692000 Einwohnern, 426 Buchdruckereien, 340 lithographischen
Anstalten, 470 Buchhandlungen, 321 Zeitschriften aufweisen[164].
Lithogr.
Städte Einwohnerzahl Buchdrucker. Buchhandl. Zeitschriften
Anstalten
Hamburg 290000 100 114 125 59
Breslau 273000 31 30 53 33
München 230000 49 38 95 71
Dresden 220000 43 52 126 61
Leipzig 149000 92 69 400 248
Köln 145000 43 32 47 27
Königsberg 141000 14 12 25 25
Frankfurt a.
137000 58 45 71 59
M.
Hannover 123000 32 19 48 38
Stuttgart 117000 38 30 107 98
Bremen 113000 22 30 26 19
Danzig 109000 11 8 21 21
Strassburg 105000 15 16 26 32
Nürnberg 100000 26 45 40 26
Magdeburg 98000 30 18 38 19
Barmen 96000 10 31 12 9
Düsseldorf 95500 20 15 30 11
Chemnitz 95000 14 10 33 10
Elberfeld 93500 16 19 18 7
Stettin 92000 22 20 18 17
Altona 91000 17 16 14 5
Aachen 85500 14 13 17 15
Braunschweig 75000 16 12 31 18
Posen 75000 12 8 20 15
Krefeld 74000 11 21 10 4
Halle 71500 15 10 35 17
Dortmund 67000 10 5 12 12
Mühlhausen 64000 7 12 4 4
Augsburg 61500 13 7 23 19
Mainz 61000 22 25 24 17
Kassel 58500 19 14 25 14
Essen 57000 9 5 9 6
Erfurt 53500 6 9 12 14
Metz 53000 8 7 15 9
Mannheim 53000 11 7 8 11
Würzburg 51000 13 7 14 13
Lübeck 51000 11 9 10 6
Frankfurt a.
51000 2 5 8 4
O.
Wiesbaden 50500 16 9 27 22
Görlitz 50500 11 4 13 8
Karlsruhe 50000 17 14 21 15
Darmstadt 50000 20 16 26 15
Summa[164] 4176500 966 888 1737 1153
Die Bedeutung von Paris für die graphischen Gewerbe Frankreichs ist
bekanntlich eine weit tiefer eingreifende als die der Reichshauptstadt für
Deutschland. Sollte der graphische Vergleich auf die Metropole ausgedehnt
werden, so müsste man, der Deutschland eigentümlichen Organisation
gemäss, Berlin und Leipzig zusammen Paris gegenüberstellen, um
einigermassen zu einem richtigen Resultat zu gelangen. In diesem Falle
würde dann Leipzig ausfallen und Posen als 26. Stadt einrücken und damit
das M e h r der 22 deutschen Städte wesentlich beschränkt werden,
nämlich auf: 618000 Einwohner, 346 Buchdruckereien, 279 lithographische
Anstalten, 190 Buchhandlungen und 88 Zeitschriften.
Die
Papierfab
Die Papierfabrikation Deutschlands ist eine sehr bedeutende und rikation.
beträgt nahe an 250 Millionen Kilogramm. Zur Herstellung sind 785
Papiermaschinen und 185 Bütten und die Arbeit von etwa 80000
Menschen notwendig. Ausserdem wirkten noch 260 Holzschleifereien, 45
Rohstofffabriken und 20 Cellulosefabriken, zusammen mit etwa 7500
Arbeitern. Rechnet man hinzu etwa 40000 Menschen, die mit
Hadernsammeln und Nebenarbeiten beschäftigt sind, so giebt das ein
Arbeiterkontingent von rund 128000 Köpfen. Um den Umfang dieser einen
Branche richtig zu beurteilen, wären noch alle diejenigen mitzuzählen, die
sich mit dem Papierhandel und der Fabrikation von Brief- und
Luxuspapieren, Pergamentpapier, Couverts, Tapeten, Handlungsbüchern,
Papierwäsche etc. etc. beschäftigen[165].

Die Buchbinderkunst[166] stand, als nach der Mitte unseres Jahrhunderts


die Buchdruckerkunst auf ihrem Höhepunkt angelangt war, noch
beträchtlich zurück und es dauerte auch noch eine zeitlang, ehe sie einen
frischen Anlauf nahm.
Der Leinwand-„Einband“ dominierte vollständig. Man begnügte Der
sich nicht wie in England mit diesem als einer provisorischen Leinwand
band.
Hülle, sondern die Leinwanddecke war in Deutschland das
definitive Kleid des Buches für Jahrhunderte (?). In der Verzierung solcher
Bände ging man noch weiter als in England und verwendete neben den
Goldverzierungen oft die Hochprägung, bei welcher Medaillon-Porträts,
Büsten, allegorische Figuren, Lyras, Palmenzweige, sogar Landkarten zur
Verwendung kamen. Die Hautreliefs wurden bald flach gedrückt. Man
gewöhnte sich, den Einbanddeckel als etwas zu betrachten, was er nicht
ist und nicht sein soll: ein illustrierter Titel oder ein Frontispice, um den
Inhalt des Buches zu erläutern.
Der Betrieb des deutschen Buchhandels und die deutschen Die
Verhältnisse waren dieser Verwendung des Leinwandbandes Massenbä
nde.
günstig. Die Verleger liessen ganze Auflagen in Leinwand binden
und unter dem Publikum verbreiten. Ausser den Verlegern waren es noch
die „Grosssortimenter“, welche dem Leinwandband Vorschub leisteten. Die
Genannten kaufen von den Verlegern grosse Partien gangbarer Bücher,
lassen dazu „stilvolle“ Platten anfertigen und verkaufen nun die
gebundenen Bücher an die eigentlichen Sortimentshändler zu
Bedingungen, die es den letzteren noch möglich machen, dem Publikum
so wohlfeile Preise zu stellen, wie sie ein einzelner Privatbesteller beim
Buchbinder auch nicht annähernd erzielen kann.
Im Prinzip ist diese Einrichtung gewiss eine höchst praktische, aber die
Preise werden der Konkurrenz halber dem Buchbinder gegenüber so
heruntergedrückt, dass Pfennige den Ausschlag geben, wodurch es dem
Buchbinder fast unmöglich wird, auf Falzen, Heften und auf die Zuthaten
an Pappe, Vorsetzblättern u. dgl. die nötige Sorgfalt und Ausgabe zu
wenden.
Hinsichtlich der Dekoration des Leinwandbandes sind in Fortschrit
jüngster Zeit ganz wesentliche Fortschritte gemacht worden. Die te im
Geschma
schreienden Farben der Leinwand haben den zarteren ck.
Modefarben und der Pergament-Imitation Platz machen
müssen[167]. Das „Bemalen“ oder „Ausmeisseln“ der Bände durch
Figurales, Landschaftliches etc. hat mehr und mehr aufgehört und wird
durch Flachornamente ersetzt, für welche man die vielen trefflichen
Vorbilder früherer Zeit benutzt oder tüchtige Künstler gewinnt. Ein Fehler
ist noch ziemlich verbreitet: der übergrosse Reichtum der Ornamentierung
und Überladung mit Silber, Gold und Mosaik imitierenden Farben. Je mehr
man sich gewöhnen wird, die körnige Chagrin-Imitation und einfache
Ornamentierung zu verwenden, um so mehr wird das Leder-Surrogat,
welches wir nun einmal nicht werden entbehren können, seinen Platz in
zweckmässiger Weise ausfüllen.
Die Handarbeit, namentlich den Halbfranz, lernt man in der Die
letzten Zeit in Deutschland wieder schätzen und es sind hierin Handarbe
it.
tüchtige Fortschritte gemacht worden. Von Lederbänden wird
nicht viel die Rede sein können, solange die Kreise der wohlhabenden
Kaufleute und Fabrikanten, sogar Magnaten keine gewählte Bibliothek
besitzen. Die Sammler sind meist unter den Gelehrten, Beamten, selbst
unter den weniger gut dotierten Landgeistlichen zu suchen. Deshalb
haben die Buchbinder, falls es ihnen wirklich um die Förderung ihrer Kunst
Ernst ist, sich vor der Klippe zu hüten, als Revanche für den Druck, den sie
durch die Verleger und Grosssortimenter zu erleiden hatten, das Publikum
zu überteuern und zu glauben, dass jeder, der gern ein Buch hübsch
binden lassen will, ein reicher Büchernarr sei, dem man jeden Preis
abverlangen könne. Begnügt sich der Buchbinder bei reeller Bedienung mit
einem mässigen Vorteil, so wird er immer noch in Deutschland ein
kaufendes Publikum finden.
In Bezug auf ein solches ist der Buchbinder in Österreich schon Die
besser situiert und die Buchbindung hat demzufolge auch schon Buchbind
erkunst in
beträchtliche Fortschritte gemacht. Doch betreffen diese im Österreic
allgemeinen noch mehr die Album- und Portefeuille-Fabrikation h.
als die eigentliche Buchbinderei. Eine mächtige Einwirkung auf
den Geschmack hat das Kunstgewerbe-Museum in Wien geübt. Man
schliesst sich mehr der Art der Franzosen an und übertrifft diese in der
Ledermosaik, die eine wirklich eingelegte Arbeit ist.
Was den Betrieb der Buchbinderei betrifft, so hat dieser einen Die
sehr wichtigen Anteil an den Vorteilen gehabt, welche das Vorteile
der
Maschinenwesen jedem Geschäft gebracht hat (vgl. Kap. XI). Die Maschine
Maschinen besorgen das Falzen der Bogen, das Walzen des n.
gefalzten Bogens, das Heften desselben mit Faden oder Draht,
das Beschneiden und Pressen des Buches, das Abrunden des Rückens, das
Einfassen, die Anbringung der Kapitäle, das Schneiden und Abschrägen
der Pappen, das Pressen und Vergolden der Deckel. Für die sonstigen
Arbeiten der Buchbinder sind die Couvert- und Klebemaschinen, Liniier-
und noch viele andere Maschinen da.

Fußnoten:
[150] Zwei wertvolle neuere Einlagen in der Streitfrage „Antiqua oder
Fraktur“ sind: F. Soennecken, Das deutsche Schriftwesen und die
Notwendigkeit seiner Reform, Bonn 1881, und Dr. Johann Kelle, Die
deutsche und die lateinische Schrift, Separatabdruck aus der
Rundschau 1882.
[151] Um zu einiger Klarheit über das Verhältnis der Antiqua zu der
Fraktur in der deutschen Typographie zu kommen, hat der Verfasser
dieses Buches eine Zählung der litterarischen Erzeugnisse des Jahres
1881 nach dem Hinrichsschen Katalog unternommen. Von 14320
Nummern sind 8894 mit Fraktur, 5426 mit Antiqua gedruckt (gleich 62
zu 38 Proz.). In zwei grosse Gruppen nach den obigen Andeutungen
der praktischen Verwendung geteilt, giebt die „wissenschaftliche
Gruppe“ 7142 Werke, davon 2896 mit Fraktur, 4246 mit Antiqua (gleich
40 zu 60 Proz.); die zweite Gruppe, die „populäre Litteratur“, weist
7178 Werke auf, davon 5998 mit Fraktur, 1180 mit Antiqua (gleich 83½
zu 16½ Proz.). Zeitungen sind hierbei nicht mitgezählt, wohl aber
Wochen- und Monatsschriften. Wie überwiegend die Antiqua in dem
Accidenzfache verwendet wird, zeigt z. B. eine genaue Aufstellung der
C. G. Naumannschen Accidenzdruckerei in Leipzig, nach welcher von
9447 Aufträgen in dem Jahre 1878 nur 161 in Frakturschrift bestellt
waren.
[152] Lud. Hoffmann, Geschichte der Bücherzensur. Berlin 1879. —
Die Preussische Pressgesetzgebung unter Friedr. Wilhelm III. Leipzig
1881. — Fr. Kapp, Aktenstücke zur Gesch. der Preuss. Zensur etc.
(Archiv d. B.-B.-V. IV). Leipzig 1879. — R. E. Prutz, Zur Geschichte d.
Presse in Preussen (Deutsch. Mus. 1857, 11).
[153] K. Biedermann, Deutschland im XVIII. Jahrhundert. 1. Bd. 2.
Aufl. Leipzig 1880. — Friedr. Perthes' Leben. 6. Aufl. Gotha 1872.
[154] C. B. Lorck, Geschichte des Vereins der Buchhändler zu Leipzig.
Leipzig 1883.
[155] H. E. Brockhaus, Friedrich Arnold Brockhaus. Sein Leben und
Wirken. 3 Bde. Leipzig 1872.
[156] Fr. Frommann, Geschichte des Börsenvereins. — Der Börsenbau
(Kap. II in Lorcks Gesch. d. Vereins d. Buchh. zu Leipzig). — Statut des
Börsenvereins vom 25. April 1880.
[157] Katalog der Bibl. des Börsen-Vereins. Leipzig 1869. Nachtrag
1870.
[158] Ein Jahrgang des Börsenblattes bildet jetzt vier Quartbände,
zusammen in einem Umfange von gegen 6000 Seiten. Seit 1856 wurde
es von Jul. Krauss redigiert.
[159] E. Berger, Die Anfänge der period. Litteratur des Buchhandels
(Publ. d. B.-B.-V. 11). Leipzig 1875.
[160] O. A. Schulz, Der Buchhandel (Schiebes Handelslexikon). — A.
Schürmann, Der Buchhandel (Pierers Universallexikon). — K. Buchner,
Schriftsteller und Verleger vor 100 Jahren. — Dr. A. Kirchhoff, Litteratur
und Buchhandel am Schluss des XVIII. Jahrh. — J. H. Meyer, Die
genossenschaftlichen Buchhandlungen des XVIII. Jahrh. (Archiv d. D.
B.-B.-V. 11). Leipzig 1879. — A. Prinz, Der Buchhandel von 1815 bis
zum Jahre 1863. 7 Teile. Altona 1855–1863. — E. Berger, Aus dem
Buchhandel vor 50 Jahren (Publ. d. B.-B.-V. 11). Leipzig 1875. —
Derselbe, Der deutsche Buchhandel in d. J. 1815–1867 (Arch. d. B.-B.-
V. 11). Leipzig 1879. — K. Buchner, Beiträge zur Gesch. d. Buchhandels.
[161] R. E. Prutz, Geschichte des deutschen Journalismus. Hannover
1845. — Derselbe, Fortschritte der Zeitungspresse (Deutsch. Museum
1858 Nvbr.). — J. Kuranda, Deutsche Zeitungen und Zeitschriften. — H.
Wuttke, Die deutschen Zeitschriften. 2. Aufl. Leipzig 1875. — Einen
Einblick in die Herstellung einer Zeitung gewährt: J. H. Wehle, Die
Zeitung. 2. Aufl. Wien 1883.
[162] Die Geschichte des Deutschen Buchdrucker-Vereins von 1869–
1876 ist in den Annalen der Typographie 1870, Nr. 341–390 im
Zusammenhang ausführlich behandelt. Die „Annalen“ waren von der
Begründung des Vereins bis 1876 Organ desselben und wurden von
dessen Sekretär Carl B. Lorck herausgegeben. Jetzt giebt der Verein
selbst in unregelmässigen Zwischenräumen die „Mitteilungen aus dem
Deutschen Buchdrucker-Verein“ heraus.
[163] Die etwa 700 Offizinen, welche Buchdruckerei und
Steindruckerei vereinigen, sind doppelt angeführt.
Das Deutsche Reich, Österreich und die Schweiz als graphische
Einheit betrachtet ergiebt die Zahl von 6993 graphischen Anstalten mit
9378 Schnellpressen und etwa 13500 Tret- und Handpressen. Die
Details über Österreich und die Schweiz finden sich S. 406 und S. 436.
[164] Die Angaben hier können zwar keinen Anspruch auf absolute
Genauigkeit erheben, kommen jedoch der Wahrheit so nahe, dass sie
genügen, um sich ein richtiges Bild zu machen. Für die Angaben der
Bevölkerung wurde Neumanns „Geographisches Lexikon“, Leipzig 1883,
mit Abrundung der Einwohnerzahl auf 500 benutzt; für die der
Buchdruckereien und der lithographischen Anstalten „Klimsch'
Adressbuch der Buch- und Steindruckereien“, Frankfurt a. M. 1880; für
die Buchhandlungen „Schulz' Adressbuch für den deutschen
Buchhandel“, Leipzig 1882, für die Zeitschriften R. Mosses
„Zeitungskatalog“, 1882; die in diesem fehlenden Zeitschriften sind
ohne Einfluss auf das Gewerbe.
[165] J. Chr. Schäfer, Sämtliche Papierversuche. Regensburg 1772.
— L. Müller, Die Fabrikation des Papiers. 4. Aufl. Berlin 1877. —
Lenormand, Handbuch der gesamten Papierfabrikationen. 3. Aufl.
Weimar 1881.
[166] R. Steche, Zur Geschichte des Bucheinbandes (Archiv d. D. B.-
B.-V. Bd. I). Leipzig 1878. — G. Fritzsche, Moderne Bucheinbände.
Leipzig 1878. — C. Bauer, Handbuch der Buchbinderei. Weimar 1881.
— L. Brade, Illustriertes Buchbinderbuch. Halle 1881.
[167] Im Deutschen Reiche giebt es nur eine Fabrik „englischer
Leinen“, die von Schultze & Niemann in Eutritzsch bei Leipzig.
X. KAPITEL.

DIE SCHRIFT UND DIE ILLUSTRATION


IN DEUTSCHLAND-ÖSTERREICH.

Aufschwung der Schriftgiesserei. Ed. Hänel. Die deutsche Druckschrift.


Walbaum Vater und Sohn. Hamburg, Berlin, Leipzig, Frankfurt a. M.
Österreich. G. Haase, C. Faulmann. Die Stereotypie, die Galvanoplastik,
die Dynamo-Elektrik. Die Giessmaschine. Die Illustration: Verfall im
XVIII. Jahrhundert, Wiedererwachen des Holzschnitts. Die Unger,
Gubitz, Unzelmann, Kretzschmar u. a. Österreich: Prestel, Höfel, Knöfler
u. a. Die Planotypie. Die Stigmatypie: Carl Fasol.

LANGSAMER als in England und Frankreich entwickelte sich


Aufschwu
ng der
Schriftgie
die Schriftgiesserei in Deutschland. Erst aus den dreissiger sserei.
Jahren datiert der eigentliche Aufschwung des reineren Ed. Hänel
Geschmacks in den Produktionen derselben und an Einfluss in
dieser Richtung kam niemand Eduard Hänel gleich. Er führte die neuesten
und schönsten französischen und englischen Antiquaschriften ein, liess die
geradestehende griechische, Kanzlei, fette und halbfette, gothische und
andere Zier- und Auszeichnungsschriften schneiden oder erwarb aus dem
Auslande die besten Matern zu denselben.
Im Accidenzdruck brachte Hänel eine vollständige Umwälzung hervor
und aus seiner Magdeburger Offizin, und nach dem Brande derselben im
Jahre 1838 aus seinem Berliner Institut gingen vorzügliche Druckarbeiten
hervor. Er war der erste, der den Compound-Druck (S. 80), den er
Congreve-Druck nannte, nach Deutschland brachte. Mit seinen Guillochen-
und Unterdruckplatten, namentlich seinen Spitzenmustern enthusiasmierte
er das deutsche Publikum. Fast kein Umschlag, ja kaum ein
Rechnungsformular konnte damals ohne Guillochen und Buntdruck
hergestellt werden. Bereits 1837 hatten seine Zierstücke die Zahl von 2813
erreicht.
Der Kampf mit der Lithographie ward damals mutig von den
Buchdruckern aufgenommen. Viele der letzteren warfen sich mit Eifer auf
das Accidenzfach und andere Schriftgiesser folgten dem Beispiel Hänels.
Es war eine Zeit des regsten, lustigsten Schaffens, vom Guten, Halbguten
und Geschmacklosen, vom Praktischen und Unpraktischen unter einander.
Noch vor Hänel hatten F. W. Gubitz in Berlin und der F. W.
Kammergerichtsassessor W. Pfnorr in Darmstadt manche Gubitz.
W. Pfnorr.
Beiträge im Ornamentfache geliefert, unter welchen die
Einfassungen mit Säulen, umwunden von Epheu- und Blumenguirlanden
oder mit vollständigen schweren architektonischen Aufbauten einen
wichtigen Platz einnehmen. Auch viele Polytypen stammen von Gubitz, der
im Jahre 1836 bereits 1668 solcher geschnitten hatte. Nach Hänels
Vorangehen trat nun auch ein besserer Geschmack in den Einfassungen
und eine grössere Leichtigkeit in der Ausführung ein. Vielen Beifall fanden
die sogenannten Kaleidoskop-Einfassungen, aus sehr kleinen
systematischen Stückchen bestehend, die sich in die mannigfaltigsten
Formen zusammenfügen liessen und congreveartig in verschiedenen
Farben gedruckt manchmal eine recht hübsche Wirkung hervorbringen
konnten. Auch zu Kapitel-Anfangs- und -Schlussvignetten wurden sie
zusammengesetzt, in Gestalt von Schmetterlingen, Vasen, Kronen etc.
Man näherte sich jedoch damit den zeitraubenden, wenig wahre
Befriedigung erzielenden Arbeiten der Stigmatypie (S. 304) und sie
verschwanden bald von der typographischen Bühne.
Die deutsche Druckschrift, die sogenannte Fraktur, nahm um Die
die Mitte des XVIII. Jahrhunderts eine sehr niedrige Stufe ein. deutsche
Druckschr
Die männliche Kraft und das Urwüchsige der gothischen Schrift, ift.
Eigenschaften, welche die Schwabacher Schrift wenigstens noch
teilweise besass, waren ganz verloren gegangen, ohne dass die Fraktur
durch Eleganz das ersetzte, was ihr an Kraft gebrach. Nachdem J. G. J.
Breitkopf, wie es scheint, lange geschwankt hatte, ob er nicht seine
reformatorischen Absichten der Verbesserung der Antiqua zuwenden
sollte, folgte er schliesslich doch der Tradition und versuchte der Fraktur
eine kunstgerechtere Haltung zu geben (S. 365). Etwas Mustergültiges
vermochte jedoch auch Breitkopf nicht zu schaffen, noch weniger J. F.
Unger in Berlin.
Erst Erich Walbaum in Weimar und namentlich seinem Sohne Erich
Theodor Walbaum gelang es, eine Frakturschrift herzustellen, die Walbaum.
Th.
auf längere Zeit und allgemein sich Geltung erwarb. Der Vater Walbaum
war anfänglich Konditor, zeigte jedoch einen solchen Geschmack † 12. Juli
im Ornamentieren, dass er von Sachverständigen veranlasst 1830.
wurde, sich der Stempelschneiderei zu widmen. Der Sohn Theodor
arbeitete erst als Gewehrgraveur wie der berühmte englische
Schriftgiesser Caslon (I, S. 268), wurde jedoch später von seinem Vater
als Stempelschneider ausgebildet.
Die Vorzüge der Walbaumschen Frakturschriften liegen namentlich in
dem Ebenmass aller Buchstaben durch alle Grade hindurch von dem
kleinsten bis zu dem grössten. Form und Zurichtung sind gleich gut; die
Stärke ist gerade die rechte; Leserlichkeit geht mit Dauerhaftigkeit Hand in
Hand. In der Fraktur nimmt die Walbaumsche Schrift fast die Stelle ein,
wie in der Antiqua die Didotsche, und würde noch heute, neu mit den
Hülfsmitteln der neuesten Technik zweckmässig durchgeführt, immer eine
klassische Fraktur bleiben, wenn wir diese Bezeichnung überhaupt für eine
Schrift modernen Ursprungs und, man sage für ihre nationale
Berechtigung und ihre Zweckmässigkeit für das Volk was man will, nicht in
dem Besitz derjenigen Schönheit, welche wir von dem, was wir klassisch
nennen, verlangen, gebrauchen dürften.
Theodor Walbaum starb, als Künstler und Mensch gleich geachtet, in
dem Bade Berka bei Weimar und wurde von seinem Vater überlebt. Das
Walbaumsche Geschäft erwarb F. A. Brockhaus in Leipzig, welcher es im
Jahre 1843 nach dort verlegte.
Seit Walbaum hat Deutschland eine grosse Zahl von Die
Frakturschriften aufzuweisen, bald magerere, bald fettere; bald neueren
Fraktursc
eckigere, bald rundere; vielen derselben ist die Korrektheit hriften.
nachzurühmen. Oft sind sie sich selbstverständlich so ähnlich,
dass nur ein sehr geübtes Auge einen Unterschied bemerkt. Leider haben
sehr viele Druckereien die üble Gewohnheit, einzelne Grade aus den
Garnituren verschiedener Giessereien untereinander anzuschaffen, indem
sie bald den Launen der Besteller nachgeben, bald nur dem eigenen
Antrieb folgen, nicht berechnend, dass selbst die weniger schönen
Schriften konsequent durch alle Grade durchgeführt ein weit gelungeneres
Ganzes hervorbringen, als Schriften sogar des schönsten Schnittes, wenn
sie unter einander gemengt sind.
Im Jahre 1838 hatten Deutschland, Österreich und die Schweiz bereits
gegen 100 Giessereien, die beständigen Zuwachs erhielten.
Im Norden Deutschlands waren die bedeutendsten derselben J. D.
J. D. Trennert in Altona und Genzsch & Heyse in Hamburg, welche Trennert.
Genzsch
hauptsächlich die Bedürfnisse des skandinavischen Nordens und & Heyse.
Russlands deckten. Der Gründer der letztgenannten Firma, J. A. J. A.
Genzsch aus Audigast in Sachsen, ward 1827 erster Faktor bei Fr. Genzsch
Dresler & Rost-Fingerlin, als diese in Frankfurt a. M. eine * 14.
Sept.
Schriftgiesserei etablierten. Im Jahre 1833 assoziierten sich 1800,
Genzsch und J. G. Heyse aus Bremen und führten die † 29. Juni
Thorowgoodschen Schreibschriften in Deutschland ein. Die 1869.
Firma, seit 1866 im Besitz von Emil Julius Genzsch, dem Sohne des
Gründers, erwarb sich besondere Verdienste um die Einführung der
Renaissance-Antiqua mit entsprechenden Kopfleisten, Vignetten und
Initialen, sowie um die Umgestaltung der Schwabacher Schriften. Da man
für letztere nicht so wie für die Antiqua ältere mustergültige Vorbilder
hatte, weil die Stempelschneiderei Deutschlands zur Zeit der Einführung
der Schwabacher (I, S. 41) auf keiner hohen Stufe stand, so musste der
Versuch gemacht werden, etwas Neues zu schaffen, und es ist in der That
Genzsch & Heyse gelungen, sehr ansprechende moderne Schwabacher
Schriften in allen Grössen herzustellen. In jüngster Zeit etablierten
Genzsch & Heyse eine Schriftgiesserei in München durch Ankauf zweier
dortigen Firmen[168].
In Braunschweig wirkten als Schriftgiesser namentlich Fr. Vieweg Fr.
& Sohn, allerdings nur für den eigenen Bedarf schaffend, aber Vieweg &
Sohn.
sehr für Verbreitung des guten Geschmacks wirkend.
Die Hänelsche Offizin in Berlin ging nach verschiedenem Berlin.
Wechsel in die Hände W. Gronaus über und behauptete sich unter Hänel-
Gronau.
dessen kräftiger und einsichtsvoller Leitung als eine der
vorzüglichsten Anstalten Deutschlands. Im Hänelschen Geiste wurden
Ornamente, Zier- und Brotschriften in reicher Fülle geschaffen, zugleich
der Schnitt griechischer und russischer Schriften gepflegt. Auch als
Druckerei behielt die Offizin einen ehrenvollen Platz. Hier wirkte J. H. F.
als Faktor J. H. F. Bachmann aus Stralsund. Acht Jahre verbrachte Bachman
n * 8. Juli
dieser in Kiew als Leiter erst der Universitätsbuchdruckerei,
später der Regierungsdruckerei. Nach Deutschland 1821,
† 27. Juli
zurückgekehrt, weilte er 1850–1860 bei J. H. Meyer in 1876.
Braunschweig, wo er den Grund zu seiner ziemlich
umfangreichen fachschriftstellerischen Thätigkeit legte. Sein letztes Werk
war das 1875 in Weimar erschienene ausführliche „Handbuch der
Buchdruckerkunst“.
Eine bedeutende Thätigkeit entwickelten Trowitzsch & Sohn, Trowitzsc
auch als Kalenderverleger bekannt. Die von Deckersche Giesserei h & Sohn.
v. Decker.
schaffte in erster Richtung hauptsächlich für den eigenen Bedarf.
Ihre Frakturschriften von einer etwas eigentümlichen Form sind korrekt
und tüchtig durchgeführt, konnten jedoch nicht allgemein gefallen. Es hat
fast den Anschein, als wäre die Absicht vorhanden gewesen, nach dem
Beispiel der Nationaldruckerei in Paris etwas Absonderliches für sich allein
zu haben, ohne Rücksicht darauf, ob es zugleich etwas Schönes sei. Im
Jahre 1873 zur Zeit der Wiener Ausstellung betrug die Zahl der Stempel
und Matrizen über 100000. Deckers lieferten auch orientalische Schriften,
die unter der Aufsicht der Akademie der Wissenschaften geschnitten
wurden, welche letztere sich überhaupt um diesen Zweig der
Schriftgiesserei verdient machte. Als Stempelschneider in dieser Beyerh
Richtung erwarb sich Beyerhauss einen Ruf. Unter anderem lieferte auss.
er für die amerikanische Mission in New-York 4000 chinesische Stempel,
mit welchen 22000 der am häufigsten vorkommenden Kombinationen
herzustellen waren. F. Theinhardt lieferte Hieroglyphen nach der F.
Anleitung des Professors C. R. Lepsius, die sich von den Theinhar
dt.
Niesschen dadurch unterscheiden, dass sie kein schwarzes
Typenbild, sondern nur wie mit der Feder gezeichnete Umrisse bilden. Die
Zahl der geschnittenen Charaktere beläuft sich auf über 1300. Auch
Theinhardts sonstige fremdländische Schriften und andere Leistungen sind
vorzüglich[169].
Treffliche Einfassungen und Ornamente lieferte Heinr. Ehlert. H. Ehlert.
Rastlos schaffte im Accidenzfach Wilh. Woellmer, und namentlich W.
Woellmer.
erwarben sich seine Züge, Einfassungen und Schreibschriften,
besonders die Rundschriften[170], grosse Beliebtheit, wozu seine von W.
Büxenstein in Berlin genial arrangierten und meisterhaft gedruckten
Proben das ihrige beitrugen.
Je grössere Dimensionen das Geschäft im allgemeinen annahm, um so
vorteilhafter war es, wenn sich Spezialitäten vom Stamm abzweigten und
besondere Geschäfte bildeten. Als eine solche Spezialität, welche eine
ganz besondere Pflege nötig hatte, ist die Fabrikation von Messinglinien,
galvanoplastischen Arbeiten u. dgl. zu bezeichnen. In der H.
Fabrikation der ersteren hat es H. Berthold in Berlin zu einer Berthold.
grossen Virtuosität gebracht. Besonderen Dank seitens seiner
Berufsgenossen erwarb er sich durch seine Bemühungen für die
Einheitlichkeit des Schriftkegels und die Herstellung eines
Normaltypometers. Unter Beihülfe wissenschaftlicher Kräfte ersten
Ranges, darunter des Direktors des Observatoriums in Berlin, Professor Dr.
Forster, stellte er nach achtzehnmonatlicher Arbeit ein solches Typometer
in einer Länge von 30 cm = 133 Nonpareil = 798 Punkte her[171]. Leider
ist auch bei diesem neuen verdienstlichen Versuche nicht das Metermass
nach seinen Einheiten genau zugrundegelegt. Man sieht hier, wie bei den
orthographischen Verbesserungsplänen, wie schwer es ist, eine
wissenschaftliche Reform durchzusetzen, wenn nicht ein Gebot des
Staates dahintersteht. Bei dem enormen vorhandenen Setzmaterial und
den übergrossen Schwierigkeiten, dieses schrittweise nach einem neuen
System zu vervollständigen oder umzumodeln, ist auch nicht abzusehen,
wann eine Einheitlichkeit durchgeführt sein kann, denn solche
Radikalkuren anzuwenden, wie die Reichsdruckerei es that, indem sie ihre
gesamten Schriftenvorräte ins Zeug warf und umgoss, sind nicht
jedermanns Sache.
In Jena schnitt C. Hanemann nach Angaben des Professors W. C.
Lagus eine arabische Schrift für die Frenckellsche Offizin in Haneman
n.
Helsingfors.
Leipzig nahm in der Schriftgiesserei nicht eine so bedeutende Leipziger
Stelle ein, wie man es hätte vermuten sollen. F. A. Brockhaus, Schriftgie
sser.
Breitkopf & Härtel, Karl Tauchnitz, F. Nies und dessen Nachfolger
C. B. Lorck und W. Drugulin u. a., welche hauptsächlich nur im Interesse
der eigenen Druckoffizinen arbeiteten, finden Erwähnung bei der
Besprechung der Wirksamkeit dieser (Kap. XII). Gustav Schelter zeichnete
sich namentlich durch seine Musiknoten aus. Der talentvolle, leider zu früh
aus dem Leben geschiedene Ernst Otto war ganz besonders um die
Verbesserung des Schriftmetalls bemüht. Die einzige bedeutende
Schriftgiesserei war langezeit hindurch die von J. G. Schelter & J. G.
Giesecke, die einen ganz besonders regen Verkehr mit dem Schelter
&
Norden unterhielt und eine Filiale in Wien (jetzt Meyer & Giesecke.
Schleicher) errichtete. Die Leipziger Anstalt ist in jüngster Zeit ganz nach
amerikanischen Grundsätzen umgebildet und gehört durch ihren Umfang
und die ausgedehnteste Anwendung von Hülfsmaschinen, welche sie
selbst baut, zu den bedeutendsten Schriftgiessereien der Jetztzeit, liefert
zugleich kleine Druckmaschinen und alles, was zum Arbeitsmaterial
gehört. In jüngster Zeit haben Schelter & Giesecke sich besonders um das
Schaffen schöner Ornamente und Einfassungen verdient gemacht[172].
Die als Schriftgiesserei noch junge Firma Julius Klinkhardt, J.
früher schon als Verlagshandlung und Buchdruckerei bekannt, Klinkhard
t.
entwickelt eine grosse Thätigkeit. Der Gründer der Firma, Julius
Klinkhardt, kaufte 1864 die gut eingerichtete Buchdruckerei von Lüders &
Umlauf, 1871 die bekannte lithographische Anstalt von J. G. Bach und die
Schriftgiesserei von Gust. Schelter. Unter der Beteiligung der Söhne Robert
und Bruno Klinkhardt nahm das Geschäft einen ungemein raschen
Aufschwung; in Wien wurde 1877 eine Filiale errichtet. Die Anstalt machte
namentlich in betreff der Musiknoten und der dekorativen Typographie
bedeutende Anstrengungen[173].
Als Galvanoplastiker erwarb sich in Leipzig C. A. Kloberg, als Galvanopl
Graveur R. Gerhold Ruf. In Magdeburg zeichnete sich in diesem astiker
und
Fache Feodor Schmitt (früher Falckenberg & Co.) aus, dessen Graveure.
Spezialitäten Numerierwerke und alle Messingarbeiten für
Buchbinder sind.
Frankfurt A. M. behielt, mit dem benachbarten Offenbach, selbst Frankfurt
nachdem der Hauptsitz der Typographie und des Buchhandels a. M.
nach Leipzig verlegt war, die Superiorität als Sitz der Schriftgiesserei. Ein
verdientes Ansehen genoss dort schon lange die Schriftgiesserei J.
von J. Andreae (I, S. 131), die einen wesentlichen Einfluss auf die Andreae.

Ausbildung des guten Geschmacks geübt hat. Sie verbesserte das


Konkordanzsystem und war eifrig für die Einführung des einheitlichen
Kegel- und Höhesystems (I, S. 160) thätig. Im Jahre 1838 ging das
Geschäft auf Benj. Krebs über, der auch die ersten guten deutschen
Schreibschriften lieferte, deren Zeichen zwar, wie die der Anglaise, auf
schrägem Kegel geschnitten, jedoch nicht wie die letztere aus
verschiedenen Stücken zusammengesetzt werden mussten. Jedes
Typenstück ist zugleich ein vollständiger Buchstabe, nur existieren, wie in
der Ronde, von manchen Buchstaben Varianten (bis zu fünf) unter
Berücksichtigung der Anschlüsse an die Nachbarbuchstaben. Krebs hat
auch durch sein für die damalige Zeit (1827) vortreffliches und heute noch
nicht übertroffenes „Handbuch der Buchdruckerkunst“ sehr wohlthätig
gewirkt. Die Firma lieferte auch vorzügliche hebräische, und in jüngerer
Zeit auch Frakturschriften, die zu den besten gehören; seit 1870 ist H.
Poppelbaum alleiniger Besitzer der Firma.
Im Jahre 1827 gründete Friedr. Dresler mit Rost-Fingerlin in F. Dresler.
Frankfurt eine Schriftgiesserei, die bald einen weiten Ruf
erlangte. Die Dreslerschen gothischen Schriften wurden allgemein
nachgeahmt und seine Fraktur fand sogar Eingang in die Nationaldruckerei
in Paris. Dresler schnitt auch Musiknoten ohne Linienansätze, welche für
sich gesetzt und dann einer, die Linien enthaltende Druckform aufgedruckt
wurden. Doch hat dieses Verfahren trotz des durch die
Zweifarbenmaschine erleichterten Doppeldruckes sich nie einbürgern
können. Die Verwendung von zweierlei Metall, Messing für die Linien und
Schriftzeug für die Noten, bietet schon wesentliche Nachteile, da die
Abnutzung eine verschiedene ist, der Druck demnach nie ein C.
recht gleichmässiger sein wird. Dreslers tüchtiger Nachfolger Carl Meyer.
Meyer verfolgte, unterstützt von Ferd. Michael, die begonnenen H.
Flinsch.
Pläne weiter und H. Flinsch, in dessen Besitz das Geschäft 1859
überging, vollendete sie.
Unter Flinsch ist die Anstalt zu der grössten Deutschlands, zu einer der
grössten der Welt herangewachsen. Im Jahre 1882 waren vorhanden: 92
Giessmaschinen, welche täglich ca. 2 Millionen Typen liefern können,
ausserdem 26 Schleif- und viele Hülfsmaschinen. Die Zahl der Arbeiter
betrug über 200. An Stempeln besass die Offizin 106000, an Matrizen
198200. Flinsch war der erste in Deutschland, der die Johnson-
Atkinsonsche Giessmaschine einführte und Matrizen von Stahl und
Neusilber verwendete, auch für die Güte und Härte des Zeugs wurden
grosse Anstrengungen gemacht.
Als Schriftschneider erwarb sich Joh. Chr. Bauer aus Hanau ein J. C.
grosses Ansehen. Nachdem er sich in England ausgebildet hatte, Bauer
* 1802,
begann er 1828 seine schönen Frakturschriften auszuführen, von † 1867.
welchen die ersten 1852 erschienen. Nach und nach folgten
andere und Bauer schnitt über 10000 Stempel. Seine Nachfolger wirken in
gleicher Richtung. Sie haben das Patent auf die Hepburnsche
Giessmaschine erworben (S. 295), deren Erfinder seine Thätigkeit dem
Frankfurter Hause widmet.
Cosman Damian May gehört halb Frankfurt, halb London an. C. D.
Geboren in ersterer Stadt, ging er 1828 nach England und war May.
bis 1845 Teilnehmer der Schriftgiesserei Miller & Richard. 1852 kam er
wieder nach Frankfurt; kehrte jedoch 1865 abermals nach London zurück.
Er schnitt Frakturschriften sowohl in einer abgerundeteren Form
(Midoline), als auch in der üblichen eckigen. Bekannter sind seine
Antiquaschriften geworden, deren treffliche Ausführung alles Lob verdient.
Die Firma J. Ch. D. Nies wurde 1834 gegründet. C. J. Ludwig, J. Ch. D.
aus der Flinschschen Schule hervorgegangen, hat sich seit 1876 Nies.
J. H.
für seine junge Firma bereits einen guten Ruf erworben. In dem Rust.
benachbarten Offenbach zeichnete sich J. M. Huck & Co. und J. C. J.
H. Rust, letzterer namentlich durch seine eleganten Ornamente Ludwig.
und Einfassungen, aus.
Stuttgart hat in der Schriftgiesserei keine grosse Bedeutung gehabt. In
neuester Zeit machte sich Otto Weisert durch seine Zierstücke, Stoffler &
Backé durch Holzschriften bemerkbar. Solche fabrizierten namentlich Sachs
& Schumacher in Mannheim, Nachtigall & Dohle in Aachen.
In Österreich stand die Schriftgiesserei lange auf einem Österreic
ziemlich untergeordneten Standpunkte. Eine Änderung hat man h.

erst Gottlieb Haase in Prag zu verdanken, der in Österreich Andr.


Haase
ungefähr dieselbe Stellung einnahm, wie Hänel in Deutschland. * 30.
Der Begründer der Firma war 1798 nach Prag eingewandert. Aug.
1804,
Sein rasch aufgeblühtes Geschäft arbeitete mit 18 Pressen und † 25. Juni
war mit einer Schriftgiesserei verbunden. Der Sohn Andreas 1864.
widmete sich nach einer sorgfältigen Erziehung der
Buchdruckerkunst und übernahm, kaum zwanzig Jahre alt, nach dem Tode
des Vaters im Verein mit seinen beiden jüngeren Brüdern Gottlieb und
Rudolph das Geschäft, das bald eins der bedeutendsten in Österreich
wurde. Im Jahre 1836 disponierte es bereits über eine Doppelmaschine,
drei einfache Schnellpressen, zwölf Stanhope- und vierzehn ältere
Handpressen, nebst zwei hydraulischen Glättpressen. Die Schriftgiesserei
zählte 45 Arbeiter und versah ganz Österreich und die Donauländer. Eine
Maschinenfabrik wurde in Wran angelegt. Nach dem Tode Andreas'
übernahm Gottlieb als Chef die Leitung der Buchdruckerei. Ihm zur Seite
stand als Dirigent der Schriftgiesserei sein Neffe Guido; Rudolph leitete die
Buchhandlung. Im Jahre 1871 ging das Geschäft in die Aktiengesellschaft
Bohemia auf, bis es Andreas Haase später wieder übernahm.
Der sehr bedeutende Aufschwung, welchen die Wiener Schriftgie
Schriftgiesserei in neuester Zeit genommen hat, entstammt sserei in
Wien.
zumteil den Bestrebungen Auers, zumteil den bei der günstigen
Wendung der Pressverhältnisse nach Wien eingewanderten deutschen
Geschäften. Die jetzt bedeutendste Schriftgiesserei Meyer & Schleicher,
welche ihre Verbindungen selbst bis Japan ausdehnt, wurde, wie bereits
erwähnt, als Filiale von Schelter & Giesecke in Leipzig gegründet. Sie
führte die Atkinsonsche Giessmaschine in Wien ein. J. H. Rust aus
Offenbach etablierte 1856 ein Geschäft. Aus einer Filiale von Krebs in
Frankfurt a. M. ward die Firma Poppelbaum & Bossow, jetzt Poppelbaum. In
jüngster Zeit folgte Jul. Klinkhardt aus Leipzig.
Ausser der Staatsdruckerei verbanden auch andere Druckanstalten mit
ihren Druckoffizinen Schriftgiessereien, so v. Waldheim, Zamarski, Fromme.
Letzterer verkaufte jedoch die Giesserei an Brendler & G. Harler. Carl
Brendler schnitt vortreffliche orientalische Schriften und die
stenographischen Typen für Faulmann.
Carl Faulmann, erst Setzer, dann Stenograph und Linguist, C.
Faulmann
Verfasser mehrerer Werke über Schrifttum und Typographie[174], und die
hat sich ganz besondere Verdienste in betreff der Lösung der Stenogra
schwierigen Aufgabe, die Stenographie in die Typographie phie.
einzuordnen, erworben. Die ersten Versuche hatte bereits 1854 Gustav
Schelter mit Typen nach Gabelsbergers System gemacht, sie fielen jedoch
nicht genügend aus. Die Staatsdruckerei liess von Joseph Leipold und
Christian Plesse Typen nach Stolzes System herstellen, die 1854 in
München ausgestellt, für den praktischen Gebrauch jedoch zu gross
befunden wurden. 1859 zeichnete Faulmann für die Staatsdruckerei neue
Typen nach Gabelsbergers System, die, von Leipold geschnitten, sich als
zweckmässig bewährten. 1864 erschienen wieder neue Typen von
Faulmann, die er auf seine Rechnung von Brendler schneiden liess und die
später von der Staatsdruckerei angekauft wurden. Diese neuesten Typen
reihen sich ohne Verbindungsstücke an einander an, wie gewöhnliche
Typen. Allerdings ist die Zahl derselben, trotz einer grossen Reduktion der
früheren 1300 Stücke, noch eine bedeutende, 800, so dass ein Kasten sie
nicht alle fassen kann, auch laufen die überhängenden Buchstaben beim
Drucken leicht Gefahr, beschädigt zu werden. Liegt es nun auch in der
Natur der Sache, dass die Geschwindschrift nie Gegenstand eines
Geschwindsatzes werden kann, so ist doch das Problem des
stenographischen Satzes als glücklich durch Faulmann gelöst zu
betrachten[175].
Betrachten wir den grossen Reichtum an Material, welchen die Reichtum
Schriftgiessereien für Einfassungen, Ornamente, Titel-, an
Schriften.
Schreibschriften u. dgl. den Setzern in die Hände liefern, so
können letztere nicht darüber klagen, dass es ihnen an Mitteln gebricht,
ihre Kunstfertigkeit zu zeigen. Eher verleitet sie der Reichtum zur
Verschwendung und unter den hunderten von Schriften wird mehr
gewühlt als gewählt und sinnlose Zusammenstellungen gemacht.
Erfreulich ist es zu sehen, wie jetzt das Ausland, das fast nur von den
Derrieyschen Einfassungen zehrte, jetzt die deutschen Produkte vielfach
benutzt, die selbst in Frankreich Eingang fanden.
Übersättigung führt zur Einfachheit und so haben in den letzten Jahren
die einfache typographische Linie und der Punkt (S. 304) eine bedeutende
Rolle gespielt und oft werden mit diesen kleinen Mitteln wirkliche
Meisterstücke ausgeführt, in welchen namentlich W. Büxenstein in Berlin,
Jul. Klinkhardt in Leipzig und die Pierersche Hofbuchdruckerei in Altenburg
excellieren, der in letzterer arbeitende taubstumme Watzulik ist ein
ausserordentliches Setzer-Genie[176].

Das Stereotyp-Verfahren[177] wird in ausgedehnter Weise in Die


Stereotyp
Deutschland geübt, ohne dass dieses selbst bedeutende eigene ie.
Verdienste um dasselbe erworben hätte, wenn sich auch Spuren
älterer Versuche zeigen.
Ein Steingutfabrikant, Schmidt in Durlach, fand auf einem Ältere
Schutthaufen seiner Fabrik das Bruchstück einer Schriftplatte in Versuche.
Porzellan, welche den Schluss einer Dedikation oder eines Gesuches an
den Grossherzog Karl von Baden seitens eines Müller d. ä., datiert Paris
den 1. August 1787, enthält, des Inhalts:
„Diese Erfindung ist in Teutschland schlechterdings unbekannt. Sie
gehört dem Amtmann Hoffmann, welcher aus einer alten Familie aus den
Markgräflich-Badenschen Landen herstammt. Ich werde mich glücklich
schätzen, wenn sie unter der Protektion Ew. Hochfürstlichen Durchlaucht,
durch mich, durch Errichtung einer Polytypie eingeführt, und alle Kirchen-
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookgate.com

You might also like