(Ebook) Microsoft Visual C++ .NET, Chapter 1 by Don Gosselin ISBN 9780619016579, 0619016574 instant download
(Ebook) Microsoft Visual C++ .NET, Chapter 1 by Don Gosselin ISBN 9780619016579, 0619016574 instant download
NET, Chapter 1 by
Don Gosselin ISBN 9780619016579, 0619016574
download
https://ebooknice.com/product/microsoft-visual-c-net-
chapter-1-55235744
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
https://ebooknice.com/product/microsoft-visual-c-net-2003-developer-s-
cookbook-2158652
https://ebooknice.com/product/primary-mathematics-workbook-2b-23520620
https://ebooknice.com/product/primary-mathematics-textbook-2b-23519854
(Ebook) MCAD/MCSD Self-Paced Training Kit: Implementing Security for
Applications with Microsoft Visual Basic .NET and Microsoft C# .NET by
Anthony Northrup ISBN 9780735621213, 0735621217
https://ebooknice.com/product/mcad-mcsd-self-paced-training-kit-
implementing-security-for-applications-with-microsoft-visual-basic-
net-and-microsoft-c-net-980502
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094
https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018
https://ebooknice.com/product/my-pals-are-here-maths-pupil-s-
book-2b-55756818
Licensed to: iChapters User
A4535_FM 2/9/09 9:06 AM Page ii
Licensed to: iChapters User
Course Technology
20 Channel Center Street
Boston, MA 02210
USA
Purchase any of our products at your local college store or at our preferred
online store www.ichapters.com
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 1
Licensed to: iChapters User
CHAPTER
1
INTRODUCTION TO
PROGRAMMING AND
VISUAL C++
In this chapter you will learn about:
♦ Computer programming and programming languages
♦ C/C++ programming
♦ Logic and debugging
♦ Creating a new project in Visual C++
♦ The Visual Studio IDE
♦ Managing the solution
♦ Visual C++ Help
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 2
Licensed to: iChapters User
When you start a program and provide it with the data it needs to function, you are
running, or executing, the program. To develop the comparison to an automobile a
little further, you can think of the driver as the program that operates the automobile.
The gas and oil that the automobile needs to operate are its data. Figure 1-1 illustrates
the concept of how hardware, software, and data all work together to execute an auto-
mobile program.
Gasoline
(data)
Driver
(computer program)
Automobile
Motor Oil
(computer hardware)
(data)
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 3
Licensed to: iChapters User
0
1
0
0
1
0
0
1
1
1
0
0
1
0
0
1
1
1
1
0 0 1 1 0 0 1 1 0
1 0 0 0 0 1 1 1 1
0 0 1 0 1 1 0 1 0
1 0 0 1 1 1 1 0 0
0 0 1 1 0 1 0 0 1
Writing a program in machine language is very difficult because you must understand
how the exact placement and combination of 1s and 0s will affect your program.
Assembly languages provide an easier (although still challenging) method of controlling
a computer’s on and off switches. Assembly languages perform the same tasks as
machine languages, but use simplified names of instructions instead of 1s and 0s.To get
an idea of how difficult it can be to program with assembly languages, examine the fol-
lowing assembly code, which only performs some simple numeric calculations.
Main proc
ƒƒƒmov ax, dseg
Aƒƒinteger ?
Bƒƒinteger ?
Cƒƒinteger ?
cseg segment para public ‘code’
assume cs:cseg, ds:dseg
Main proc
ƒƒƒmov ax, dseg
ƒƒƒmov ds, ax
ƒƒƒmov es, ax
ƒƒƒmov A, 3
ƒƒƒmov B, -2
ƒƒƒmov C, 254
ƒƒƒmov ax, A
ƒƒƒadd ax, B
ƒƒƒmov C, ax
Machine languages and assembly languages are known as low-level languages because
they are the programming languages that are closest to a computer’s hardware. Each type
of central processing unit (CPU) contains its own internal machine language and
assembly language. To write programs in machine language, a programmer must know
the specific machine language and assembly language for the type of CPU on which a
program will run. Because each CPU’s machine language and assembly language is
unique, it is difficult to translate low-level languages from one CPU to another.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 4
Licensed to: iChapters User
easier to understand than machine or assembly language code because you use words
that more clearly describe the task being performed. Examples of high-level languages
include C++, BASIC, and COBOL. To understand the difference between low-level
languages and high-level languages, consider the following assembly language code that
adds two numbers, and then assigns the result to a variable named C:
mov A, 3
mov B, 2
add A, B
mov C, A
Although easier than machine language, the above assembly language code is still diffi-
cult to understand. In comparison, the same task is accomplished in a high-level language
using a much simpler statement. For example, the following C++ statement performs the
same addition task and assigns the result to a variable named C: int C = 3 + 2;.The
syntax in C++ is much easier to understand than the syntax in assembly language.
Another advantage to high-level programming languages is that they are not CPU-specific,
as are machine and assembly languages.This means that a program you write in a high-level
programming language will run on many different types of CPUs, regardless of their machine
languages or assembly languages. However, in order to run, programs written in high-level
languages must first be translated into a low-level language using a program called a
compiler. A compiler translates programming code into a low-level format.You need to
compile a program only once when you are through writing it or after editing an existing
program.When you execute the program, you actually execute the compiled, low-level for-
mat of the program. However, each time you make any changes to an existing program, you
must recompile it before the new version of the program will execute.
Procedural Programming
One of the most common forms of programming in high-level languages is called pro-
cedural programming. In procedural programming, computer instructions are often
grouped into logical units called procedures. In C++ programming, procedures are
referred to as functions. Each line in a procedural program that performs an individual
task is called a statement. For example, a checkbook program may contain a series of
statements grouped as a function named balanceCheckbook() that balances a check-
book. Another function named sumDeposits() may be used to calculate the total of all
deposits made during a single period. A single procedural program may contain hun-
dreds of variables and thousands of statements and functions.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 5
Licensed to: iChapters User
One of the most important aspects of procedural programming is that it allows you to tem-
porarily store pieces of data in computer memory locations called variables.The informa-
tion contained in a specific variable often changes. For example, you may have a program
that creates a variable containing the current time. Each time the program runs, the time is
different, so the value varies.The value of a variable often changes during the course of pro-
gram execution. For example, a payroll program might assign employee names to a variable
named employeeName. The memory location referenced by the variable employeeName
might contain different values (a different value for every employee of the company) at dif-
ferent times. Another form of data that you can store in computer memory locations is a
constant. A constant contains information that does not change during the course of pro-
gram execution.You can think of a constant as a variable with a constant value. A common
example of a constant is the value of pi (π), which represents the ratio of the circumference
of a circle to its diameter.The value of pi never changes from the constant value of 3.141592.
The statements within a procedural program usually execute in a linear fashion, one
right after the other. Figure 1-2 displays a simple procedural program written in BASIC
that calculates and prints the average of the numbers 1, 2, and 3.The first two statements
in the program create variables named SUM and COUNT. During the course of pro-
gram execution, the numbers 1, 2, and 3 are added to the SUM variable.The COUNT
variable maintains a record of how many numbers are assigned to the SUM variable.
Finally, the average is calculated using the statement SUM / COUNT. The last state-
ment, which begins with PRINT, prints the result of the program to the screen.
LET SUM = 0
LET COUNT = 0
LET SUM = SUM + 1
LET COUNT = COUNT + 1
LET SUM = SUM + 2
LET COUNT = COUNT + 1
LET SUM = SUM + 3
LET COUNT = COUNT + 1
LET AVERAGE = SUM / COUNT
PRINT “The average is “; AVERAGE
Object-Oriented Programming
Procedural-based programs are self-contained; most code, such as variables, statements,
and functions, exists within the program itself. For example, you may have written a
small business program that calculates accounts receivable and accounts payable. To add
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 6
Licensed to: iChapters User
to the program a new function that calculates the interest on a loan, you must include
all the required code within the accounting program, using variables, statements, and
functions. If you want to use the interest calculation code in another program, you must
copy all of its statements into the new program or recreate it from scratch.
Object-oriented programming takes a different approach. Object-oriented
programming (OOP) refers to the creation of reusable software objects that can be
easily incorporated into another program. Reusable software objects are often referred
to as components. For example, you could refer to all of the interest calculation code
as a single object—which you could then use over and over again just by using the
object name. Popular object-oriented programming languages include C++, Java,Visual
Basic, and Turbo Pascal. In object-oriented programming, an object is programming
code and data that can be treated as an individual unit or component. Data refers to
information contained within variables, constants, or other types of storage structures.
The functions associated with an object are referred to as methods.Variables that are
associated with an object are referred to as properties or attributes. Objects can range
from simple controls such as a button, to entire programs such as a database applica-
tion. Object-oriented programming allows programmers to use programming objects
that they have written themselves or that have been written by others. One of the most
powerful features of object-oriented programming is that it allows programmers to use
objects in their programs that may have been created in an entirely different
programming language.
For example, if you are creating an accounting program in Turbo Pascal, you can use an
object named Payroll that was created in C++. The Payroll object may contain one
method that calculates the amount of federal and state tax to deduct, another function
that calculates the FICA amount to deduct, and so on. Properties of the Payroll object
may include an employee’s number of tax withholding allowances, federal and state tax
percentages, and the cost of insurance premiums. You do not need to know how the
Payroll object was created in C++, nor do you need to re-create it in Turbo Pascal.You
only need to know how to access the methods and properties of the Payroll object from
the Turbo Pascal program. The object-oriented Accounting program is illustrated in
Figure 1-3. In the figure, the Accounting program is composed of three separate objects,
or components: an Accounts Receivable object, the Payroll object, and an Accounts
Payable object. The important thing to understand is that you do not need to rewrite
the Payroll, Accounts Payable, and Accounts Receivable objects for the Accounting pro-
gram; the Accounting program only needs to call their methods and provide the correct
data to their properties.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 7
Licensed to: iChapters User
Accounting Program
1
Accounts
Receivable
object
Accounts
Payble
object
Payroll
object
The diagram in Figure 1-3, along with other diagrams in this book, is created
in Unified Modeling Language, or UML, which is a symbolic language for
Note visually designing and documenting software systems. Each of the symbols in
Figure 1-3 is a UML representation of a component.
Objects are encapsulated, which means that all code and required data are contained
within the object itself. Encapsulation is also referred to as a black box, because of the
invisibility of the code inside an encapsulated object. When an object is well written,
you cannot see “inside” it—all internal workings are hidden. The code (methods and
statements) and data (variables and constants) contained in an encapsulated object are
accessed through an interface. An interface represents elements required for a source
program to communicate with an object. For example, interface elements required to
access a Payroll object might be a method named calcNetPay(), which calculates an
employee’s net pay, and properties containing the employee’s name and pay rate.
You can compare a programming object and its interface to a hand-held calculator.The
calculator represents an object, and you represent a program that wants to use the object.
You establish an interface with the calculator object by entering numbers (the data
required by the object) and then pressing calculation keys (which represent the meth-
ods of the object.) You do not need to know, nor can you see, the inner workings of the
calculator object. As a programmer, you are concerned only with what the methods and
properties are and what results to expect the calculator object to return. Figure 1-4 illus-
trates the idea of the calculator interface.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 8
Licensed to: iChapters User
Program
(You)
Object
(Calculator)
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 9
Licensed to: iChapters User
Consider the class upon which the Payroll object might be based. As mentioned, the
Payroll class (upon which the Payroll object is based) may include a method named
1
calcNetPay().The Payroll class may also include a calcFederalTaxes() method, a
calcStateTaxes() method, and a deductIRAContribution() method. Some of the proper-
ties of the Payroll class may include federalTaxRate, stateTaxRate, insurancePremium, and
iraContribution. Each time you create a new instance of the Payroll object, the object
inherits its own copies of these methods and objects. For example, a company that gen-
erates its payroll once a month would create 12 separate Payroll objects. Figure 1-5 illus-
trates how the January and February Payroll objects inherit all of the methods and
properties of the Payroll class.
Payroll Class
insurancePremium
federalTaxRate
stateTaxRate
iraContribution
calcNetPay()
calcFederalTaxes()
calcStateTaxes()
deductIRAContribution()
Although you will not return to object-oriented programming for several chapters, you
need to understand that the classes and objects you can create with C++ are the most
important and powerful part of the C++ programming language. In fact, the primary
goal of this book is to provide you with a firm foundation in the concepts of classes and
object-oriented programming. However, before you can learn about classes and object-
oriented programming in detail, you need to understand some of the more basic aspects
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 10
Licensed to: iChapters User
of C++, such as data types, functions, and decision-making statements. These concepts
will be examined in the next few chapters
C/C++ PROGRAMMING
The term C/C++ refers to two separate, but related, programming languages: C and C++.
At Bell Laboratories in the 1970s, Dennis Ritchie and Brian Kernighan designed the pro-
cedural C programming language based upon two earlier languages, BCPL and B. In 1985,
again at Bell Laboratories, Bjarne Stroustrup created C++ based on the C programming
language. C++ is an extension of C that adds object-oriented programming capabilities.
You create C and C++ programs in text files using a text-editing tool such as Notepad.
The original program structure you enter into a text file is referred to as source code.
Once you finish creating your program source code, you use a compiler to translate it
into the machine language of the computer on which the program will run. The com-
piled machine language version of a program is called object code. Once you compile
a program into object code, some systems require you to use a program called a linker,
which converts the object code into an executable file, typically with an extension of
.exe. Figure 1-6 uses a simple program that prints the text Hello World to a console appli-
cation window to show how source code is transformed into to object code and then
into an executable process.
You cannot read object code or the code in an .exe file.The only code format in human-
readable form is source code. In Visual C++, you compile and link a program in a single
step known as building.You will learn how to build a program later in this chapter.
Remember that each computer contains its own internal machine language. The
C/C++ compiler you use must be able to translate source code into the machine lan-
guage of the computer, or platform, on which your program will run. A platform is an
operating system and its hardware type. For example, Windows operating systems for
PCs, Mac OS 10 operating system for Macintosh, and Solaris for SPARC are different
platforms. Numerous vendors market C/C++ compilers for various platforms. Some
vendors offer complete development environments containing built-in code editors,
compilers, and linkers. Microsoft Visual C++ and Borland C++ Builder are examples of
C/C++ professional development environments that contain built-in code editors and
compilers, as well as many other development tools.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 11
Licensed to: iChapters User
C/C++ Programming 11
1
Source code
Object code
Executable file
(HelloWorld.exe)
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 12
Licensed to: iChapters User
the ANSI/ISO standard, the same C program can usually run on many different platforms.
However, C’s closeness to assembly language can also be a disadvantage. It can make C dif-
ficult to use and not ideally suited to certain types of applications, such as graphical appli-
cations and object-based programs that you want to use with other programming languages.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 13
Licensed to: iChapters User
C/C++ Programming 13
Visual C++ supports a number of extensions to the ANSI C/C++ run-time libraries.
Extensions are new or additional features that have been added to the original run-time
1
libraries.Visual C++ extensions may or may not be supported by other C/C++ compilers,
so you cannot be absolutely certain that any programs you write that use the extensions will
be able to run on other platforms. For example, Visual C++ extends the C++ language
by allowing you to include Microsoft Foundation Classes in your programs. Microsoft
Foundation Classes (MFCs), are libraries of classes that can be used as the building blocks
for creating Windows applications with Visual C++. It is very important to understand that
any Visual C++ programs you create that utilize MFCs will not conform to the ANSI
C/C++ standards, and therefore will not be able to run with other vendor’s C/C++ com-
pilers. If you need your C/C++ program to be portable to other platforms, you must use
only the standard ANSI C/C++ run-time libraries. Nevertheless, MFCs are an extremely
powerful feature of Visual C++ because they allow you to create true Windows applica-
tions. One of the primary uses of Visual C++ is in the creation of Windows applica-
tions, and many of the projects you create in this book will include MFCs and therefore
will not conform to ANSI C/C++.
You will learn how to use the various Visual C++ libraries throughout this book.
Note
The visual aspect of Visual C++ is used for designing the user interface of certain types of
programs, such as an MFC program.You can also use your mouse to draw some user inter-
face elements of your program, such as the controls in a dialog box, using various Visual C++
tools. Figure 1-7 shows an example of the visual portion of a calculator program that you
will work on in later chapters.You will draw the user interface elements shown in the fig-
ure using the controls displayed in the Toolbox window.
Figure 1-7 Visual portion of a calculator program that you will work on in later chapters
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 14
Licensed to: iChapters User
The Microsoft Visual Studio line of development tools includes a platform called the
.NET Framework that is designed for developing and running Internet applications,
primarily Web-based applications and services. As part of the .NET Framework,
Microsoft has introduced a new programming language, C# (pronounced C sharp). C#
is an object-oriented programming language based on C/C++ that creates Web-based
programs designed to run on the .NET Framework. This text does not discuss C#, but
focuses on traditional C++ programming. Traditional C++ programs, including Visual
C++ programs, are not designed to run on the .NET Framework. Rather, they are
designed to run on standard platforms such as Windows and UNIX operating systems.
You can find a supplemental chapter online at www.course.com that discusses how to use
Managed Extensions to write C++ programs that operate on the .NET Framework.
Managed Extensions are special sets of code that allow traditional C++ programs to
function on the .NET Framework.
To locate supplemental chapters and other support material for this book,
search on 0-619-01657-4 at www.course.com.
Tip
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 15
Licensed to: iChapters User
The code in the example uses a while statement, which is used to repeat a command
or series of commands based on the evaluation of certain criteria. The criterion in the
1
example is the value of a variable named count. The while statement is supposed to
execute until the count variable is less than or equal to 10.There is no code within the
while statement body however, that changes the count variable’s value.The count vari-
able will continue to have a value of 0 (zero) through each iteration of the loop. In this
program, as it is written, a line containing the text string The number is 0 will print on
the screen over and over again.
Do not worry about how the C++ code in the example is constructed. The
example is only meant to give you a better understanding of a logical error.
Note
Any error in a program that prevents it from compiling or causes it to function incor-
rectly, whether due to incorrect syntax or flaws in logic, is called a bug. Debugging
describes the act of tracing and resolving errors in a program. Legend has it that the term
debugging was first coined in the 1940s by Grace Murray Hopper, a mathematician who
was instrumental in developing the COBOL programming language. As the story goes,
a moth short-circuited a primitive computer that Hopper was using. Removing the
moth from the computer debugged the system and resolved the problem. Today, a bug
refers to any sort of problem in the design and operation of a program.
Do not confuse bugs with computer viruses. Bugs are errors within a program
that occur because of syntax errors, design flaws, and other types of errors.
Note Viruses are self-contained programs designed to “infect” a computer system
and cause mischievous or malicious damage. Actually, virus programs them-
selves can contain bugs if they contain syntax errors or do not perform (or
damage) as their creators envisioned.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 16
Licensed to: iChapters User
name you choose in the next exercise for your projects folder, this text refers to it as the
Visual C++ Projects folder throughout the course of this text.
To create a projects folder for the Visual C++ projects you create in this text:
1. If necessary, start Windows. Open Windows Explorer or My Computer.
2. Create a folder named Visual C++ Projects (or use another name if you like).
3. In your Visual C++ Projects folder, create a folder named Chapter.01 where
you will store the projects you create in this chapter.
4. Close Windows Explorer or My Computer.
Next, you will start creating a new project that you will use for the rest of this chapter
to demonstrate the basic Visual C++ development tools and windows. The project you
create in this chapter is for demonstration purposes only.
To create a new Visual C++ project:
1. Click the Start button on the taskbar. Point to the Programs folder (or the
All Programs button in Windows XP) on the Start menu. Point to Microsoft
Visual Studio .NET on the Programs menu, then click Microsoft Visual
Studio .NET. Figure 1-8 shows how Visual Studio appears when you start it
for the first time.
2. Click the New Project button in the Start Page window or point to New
on the File menu, then select Project. If necessary, when the New Project
dialog box appears, click the Visual C++ Projects folder in the Project
Types list. Also if necessary, click the More button to display more options in
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 17
Licensed to: iChapters User
the New Project dialog box. The caption on the More button changes to Less
if all of the options in the dialog box are currently displayed. The Visual C++
1
Projects folder of the New Project dialog box is shown in Figure 1–9.
Figure 1-9 The Visual C++ Projects folder of the New Project dialog box
When you first see the New Projects dialog box, you might be intimidated by
the many available options. Keep in mind that Visual Studio is a high-level
Note programming environment and that many of the options in the New dialog
box are used primarily by professional programmers. By the end of this text,
you will understand how to work with many of the Visual C++ options in the
New Project dialog box.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
1 Chapter A4535 25000 4/22/02 2:42 PM Page 18
Licensed to: iChapters User
7. Click the OK button. The Win32 Application Wizard appears, describing the
type of application you are creating. Click the Application Settings tab. In
this tab, you can select the specific application type and options that you want
to create. Figure 1-10 shows the Application Settings tab of the Win32
Application Wizard dialog box.
Figure 1-10 Application settings tab of the Win32 Application Wizard dialog box
8. The default Windows application setting type is fine for our purposes, so
click the Finish button.Visual C++ creates a new project called HelloWorld
in the HelloWorld folder in the Chapter.01 folder in your Visual C++
Projects folder. The Integrated Development Environment appears.
Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Exploring the Variety of Random
Documents with Different Content
darstellte, einen breitkrempigen Hut auf dem Kopfe, ein Plaid über
die Schulter geworfen. Die darauf folgenden Briefe waren ebenso
prächtig wie die früheren; aber es tauchten in ihnen schon
zahlreichere Interpunktionszeichen auf, die orthographischen Fehler
waren verschwunden, und alles an ihnen deutete auf die
Mitarbeiterschaft eines Mannes hin. Katja begann mir solche Dinge
zu schreiben: es würde ein guter Gedanke sein, irgendwo an der
Wolga ein großes Theater zu erbauen, und zwar jedenfalls auf
Aktien, und zu diesem Unternehmen reiche Kaufleute und
Dampfschiffsreeder heranzuziehen; Geld werde auf diese Art in
Menge zur Verfügung stehen; die Einnahmen würden ganz gewaltige
sein; die Schauspieler würden auf Grund eines
Gesellschaftsvertrages spielen. Vielleicht war das alles wirklich ein
guter Gedanke; aber es schien mir, daß solche Pläne nur aus dem
Kopfe eines Mannes hervorgegangen sein könnten.
Wie dem auch sein mochte, anderthalb bis zwei Jahre lang schien
alles gut und nach Wunsch zu gehen: Katja liebte, sie glaubte an
ihren Beruf und war glücklich; aber dann begann ich in ihren Briefen
deutliche Anzeichen des Niederganges wahrzunehmen. Dies fing
damit an, daß Katja sich bei mir über ihre Kollegen beklagte; das ist
immer das erste und mißlichste Symptom; wenn ein junger Gelehrter
oder Schriftsteller bei Ausübung seiner Tätigkeit sich über andere
Gelehrte oder Schriftsteller bitter beklagt, so bedeutet das, daß er
bereits müde geworden ist und zu seiner Berufsarbeit nicht mehr
taugt. Katja schrieb mir, ihre Kollegen kämen nicht zu den Proben
und könnten ihre Rollen niemals ordentlich; an dem Dringen auf
Ausführung abgeschmackter Stücke und an ihrer Art, sich auf der
Bühne zu benehmen, merke man bei einem jeden von ihnen eine
völlige Mißachtung des Publikums; den einzigen Gegenstand ihres
Gespräches bildeten die Einnahmen, und im Interesse der
Einnahmen erniedrigten sich die dramatischen Schauspielerinnen
zum Singen von Chansons, und die Tragöden sängen Couplets,
deren Inhalt Späße über betrogene Ehemänner und über die
Schwangerschaft treuloser Gattinnen bildeten. Überhaupt müsse
man sich wundern, daß das Bühnenwesen in der Provinz noch nicht
vollständig zugrunde gegangen sei und sich auf einer so schwachen,
morschen Grundlage halten könne.
Als Antwort schickte ich Katja einen langen und, wie ich bekennen
muß, sehr langweiligen Brief. Unter anderem schrieb ich ihr: »Ich
habe nicht selten Gelegenheit gehabt, mit älteren Schauspielern zu
reden, vornehm denkenden Männern, die mir ihr freundliches
Wohlwollen zuwandten; aus den Gesprächen mit ihnen konnte ich
entnehmen, daß die Art ihrer Tätigkeit nicht sowohl von ihrem
eigenen Urteil und ihrem freien Willen als vielmehr von der Mode
und der Stimmung des Publikums abhing; selbst die besten unter
ihnen mußten ihr Leben lang bald in Tragödien, bald in Operetten,
bald in Pariser Schwänken, bald in Feerien spielen, und hatten dabei
doch immer gleichmäßig das Gefühl, daß sie auf geradem Wege
wanderten und Nutzen stifteten. Somit hat man, wie du siehst, die
Ursache des Übels nicht bei den Schauspielern zu suchen, sondern
tiefer, in der Kunst selbst und in dem Verhältnisse des ganzen
Publikums zur Kunst.« Dieser mein Brief hatte nur den Erfolg, Katja
in heftige Erregung zu versetzen. Sie antwortete mir: »Wir beide, Sie
und ich, reden von ganz verschiedenen Dingen. Ich schrieb Ihnen
nicht von den vornehm denkenden Männern, die Ihnen ihr
freundliches Wohlwollen zuwandten, sondern von einer
Gaunerbande, die von vornehmer Gesinnung nichts weiß. Es ist eine
Horde von Wilden, die nur deswegen auf die Bühne geraten sind,
weil man sie an keiner andern Stelle angenommen haben würde,
und die sich lediglich aus Unverschämtheit Künstler nennen. Kein
einziges Talent ist darunter, wohl aber viele Unbegabte,
Trunkenbolde, Intriganten und Zwischenträger. Ich kann Ihnen gar
nicht sagen, wie es mich schmerzt, daß die Kunst, die ich so sehr
liebe, in die Hände dieser mir verhaßten Menschen geraten ist, und
wie weh es mir tut, daß die besten Menschen das Übel nur von fern
sehen, nicht näher herantreten mögen und, statt sich der Sache
anzunehmen, in schwerfälligem Stile Gemeinplätze und
Moralpredigten schreiben, die niemandem etwas nützen können …«
und so weiter, immer in demselben Tone.
Es verging wieder einige Zeit, da erhielt ich folgenden Brief: »Ich
bin in unmenschlicher Weise betrogen worden. Ich kann nicht
weiterleben. Verfügen Sie über mein Geld, wie Sie es für
angemessen halten! Ich habe Sie geliebt wie einen Vater und als
meinen einzigen Freund. Verzeihen Sie mir!«
Es hatte sich herausgestellt, daß auch ihr »Er« zu der »Horde von
Wilden« gehörte. Später konnte ich aus einigen Andeutungen
erraten, daß sie einen Versuch gemacht hatte, sich das Leben zu
nehmen. Sie hatte versucht, sich zu vergiften. Ich mußte annehmen,
daß sie darauf ernstlich krank geworden war, da ich den nächsten
Brief schon aus Jalta erhielt, wohin sie wahrscheinlich von den
Ärzten geschickt worden war. Dieser enthielt die Bitte, ihr möglichst
schnell tausend Rubel nach Jalta zu schicken, und schloß
folgendermaßen: »Entschuldigen Sie, daß dieser Brief so trübe
klingt. Ich habe gestern mein Kind begraben.« Nachdem sie in der
Krim etwa ein Jahr lang gelebt hatte, kehrte sie nach Hause zurück.
Ihr Umherreisen von Ort zu Ort hatte ungefähr vier Jahre
gedauert, und während dieser ganzen vier Jahre hatte ich, wie ich
eingestehen muß, ihr gegenüber eine sonderbare, ziemlich klägliche
Rolle gespielt. Als sie mir zuerst erklärt hatte, sie wolle
Schauspielerin werden, und mir dann von ihrer Liebe geschrieben
hatte, und als sie periodisch von Verschwendungssucht ergriffen
worden war und ich ihr häufig auf ihr Verlangen bald tausend, bald
zweitausend Rubel hatte schicken müssen, und als sie mir von ihrer
Absicht zu sterben und dann von dem Tode ihres Kindes geschrieben
hatte, da hatte ich jedesmal nicht recht gewußt, was ich tun sollte,
und meine ganze Anteilnahme an ihrem Geschick hatte sich nur
darin geäußert, daß ich viel nachdachte und ihr umfängliche,
langweilige Briefe schrieb, die ich gut und gern hätte ungeschrieben
lassen können. Und dabei sollte ich ihr doch eigentlich den leiblichen
Vater ersetzen und liebte sie auch wirklich wie eine Tochter!
Jetzt wohnt Katja nur eine halbe Werst von mir entfernt. Sie hat
sich eine Wohnung von fünf Zimmern gemietet und sich darin
ziemlich komfortabel und nach ihrem persönlichen Geschmack
eingerichtet. Wenn jemand ihre Einrichtung charakterisieren wollte,
so müßte er als das bedeutsamste Moment die Trägheit bezeichnen.
Da sind für den trägen Körper weiche Chaiselongues und weiche
Sessel, für die trägen Füße weiche Teppiche, für das träge Auge
blasse, trübe, matte Farben, für den trägen Geist an den Wänden
eine Unmasse billiger, buntbemalter Fächer und kleiner Bilder, bei
denen der dargestellte Gegenstand hinter der Originalität der
Ausführung zurücktritt, eine Menge von Tischchen und Regalen, die
mit unnützen, wertlosen Dingen ganz vollgestellt sind, formlose
Lappen statt der Vorhänge usw. Diese ganze Einrichtung mit der sich
darin bekundenden Scheu vor hellen Farben, vor Symmetrie und vor
freiem Raum zeugt nicht nur von seelischer Trägheit, sondern auch
von einer Verbildung des natürlichen Geschmacks. Ganze Tage lang
liegt Katja auf einer Chaiselongue und liest Bücher, vorzugsweise
Romane und Novellen. Das Haus verläßt sie nur einmal am Tage,
nachmittags, um mich zu besuchen.
Ich arbeite; Katja aber sitzt nicht weit von mir auf dem Sofa,
schweigt und wickelt sich in ihren Schal, als ob sie fröre. Sei es, weil
sie mir sympathisch ist, oder weil ich an ihre Besuche noch von der
Zeit her gewöhnt bin, wo sie als Mädchen so oft in meinem Zimmer
war: ihre Anwesenheit hindert mich nicht, meine Aufmerksamkeit
auf meine Arbeit zu konzentrieren. Ab und zu richte ich mechanisch
irgendeine Frage an sie, und sie gibt mir eine sehr kurze Antwort;
oder ich wende mich, um mich einen Augenblick zu erholen, zu ihr
und sehe, wie sie, in Gedanken versunken, in irgendein
medizinisches Journal oder in eine Zeitung blickt. Und dabei bemerke
ich, daß der frühere Ausdruck von Zutraulichkeit auf ihrem Gesichte
nicht mehr vorhanden ist. Ihr Gesicht sieht jetzt kalt, gleichgültig
und zerstreut aus, wie bei Reisenden, die lange auf den Zug warten
müssen. Gekleidet ist sie wie früher schön und einfach, aber
nachlässig; man sieht, daß ihrer Toilette und ihrer Frisur die
Chaiselongues und Schaukelstühle, auf denen sie tagelang
umherliegt, nicht gut bekommen. Auch ist sie nicht mehr
wißbegierig, wie sie es doch früher war. Sie richtet an mich keine
Fragen mehr; es ist, als hätte sie im Leben schon alles
durchgemacht und erwartete nicht mehr etwas Neues zu hören.
Kurz vor vier Uhr macht sich im Saale und im Salon eine
Bewegung bemerklich. Es ist Lisa, die aus dem Konservatorium
gekommen ist und ein paar Freundinnen mitgebracht hat. Man hört,
wie sie Klavier spielen, ihre Stimmen versuchen und lachen. Im
Eßzimmer deckt Jegor den Tisch und klappert mit dem Geschirr.
»Leben Sie wohl,« sagt Katja. »Zu Ihren Damen gehe ich heute
nicht mehr hinein; sie müssen mich schon entschuldigen; ich habe
keine Zeit. Besuchen Sie mich!«
Während ich sie bis ins Vorzimmer begleite, blickt sie mich
unzufrieden vom Kopfe bis zu den Füßen an und sagt ärgerlich:
»Aber Sie werden immer magerer! Warum gebrauchen Sie keine
Kur? Ich werde mich an Sergei Fedorowitsch wenden und ihn
herschicken. Der soll Sie gründlich untersuchen.«
»Das ist nicht nötig, Katja.«
»Ich begreife nicht, wie Ihre Angehörigen das mitansehen
können! Es ist geradezu eine Sünde!«
Sie zieht mit heftigen Bewegungen ihren Pelz an, wobei aus ihrer
nachlässig hergestellten Frisur mit Sicherheit zwei oder drei
Haarnadeln auf den Fußboden fallen. Die Frisur wieder
zurechtzumachen, ist sie zu träge, hat auch keine Zeit dazu; sie
schiebt die heruntergefallenen Locken unordentlich unter ihr
Mützchen und geht.
Wenn ich in das Eßzimmer trete, fragt mich meine Frau:
»Katja ist eben bei dir gewesen? Warum ist sie denn nicht zu uns
hereingekommen? Das ist doch geradezu sonderbar …«
»Aber Mama!« sagt Lisa in vorwurfsvollem Tone. »Wenn sie nicht
will, dann läßt sie es bleiben. Wir werden sie doch nicht auf den
Knien darum bitten!«
»Jedenfalls ist es eine arge Nichtachtung. Sitzt da drei Stunden
lang in Papas Arbeitszimmer und denkt nicht an uns. Na, aber wie es
ihr beliebt!«
Warja und Lisa hassen Katja. Dieser Haß ist mir unverständlich,
und wahrscheinlich muß man, um ihn zu verstehen, ein Weib sein.
Ich möchte mich mit meinem Kopfe dafür verbürgen, daß unter den
hundertfünfzig jungen Männern, die ich fast täglich in meinem
Auditorium sehe, und den hundert älteren, mit denen ich jede
Woche zusammenkomme, sich kaum einer findet, der für diesen Haß
und Abscheu gegen Katjas Vergangenheit (weil sie nämlich ein
uneheliches Kind gehabt hat) ein Verständnis besäße; und
gleichzeitig kann ich mich auf kein weibliches Wesen unter den
Frauen und jungen Mädchen meiner Bekanntschaft besinnen, das
nicht, sei es bewußt, sei es instinktiv, gegen eine solche
Geschlechtsgenossin von jenen Gefühlen des Hasses und Abscheus
erfüllt wäre. Und das kommt nicht etwa daher, daß die Frau
keuscher und reiner ist als der Mann; denn wenn Keuschheit und
Reinheit mit solchen boshaften Gefühlen verbunden sind, so sind sie
nur wenig besser als das Laster. Sondern ich erkläre mir das einfach
aus der Rückständigkeit der Frau. Wenn der heutige Mann beim
Anblick eines solchen Unglücks ein wehmütiges Gefühl des Mitleids
empfindet und sein Gewissen ihn peinigt, so lassen mich diese
Empfindungen eher auf eine hohe Stufe der Kultur und Sittlichkeit
schließen als jener Haß und Abscheu. Das heutige Weib besitzt noch
dieselbe Neigung zum Weinen und dieselbe Härte des Herzens wie
das Weib des Mittelalters. Und meines Erachtens handeln diejenigen
ganz richtig, die den Frauen raten, ihrer Bildung dieselbe Richtung
zu geben wie die Männer.
Meine Frau kann Katja auch deswegen nicht leiden, weil sie
Schauspielerin gewesen ist, ferner wegen ihrer Undankbarkeit und
wegen ihres Stolzes und wegen ihres exzentrischen Benehmens und
wegen all der zahlreichen Laster, die eine Frau immer an einer
andern herauszufinden versteht.
Außer mir und meiner Familie pflegen bei uns noch zwei oder drei
Freundinnen meiner Tochter zu Mittag zu speisen, sowie ein Herr
Alexander Adolfowitsch Gnecker, ein Verehrer Lisas, der sich um ihre
Hand bewirbt. Er ist ein junger Mann, kaum dreißig Jahre alt, blond,
von mittlerer Statur, sehr wohlgenährt, breitschultrig, mit einem
rötlichen Backenbart an den Ohren und einem dunkelgefärbten
Schnurrbärtchen, das seinem vollen, glatten Gesichte das Aussehen
einer Spielzeugfigur verleiht. Er trägt ein sehr kurzes Jackett, eine
bunte Weste, großkarierte Beinkleider, die oben sehr weit und unten
sehr eng sind, und gelbe Halbstiefel ohne Absätze. Seine Augen
stehen hervor wie bei einem Krebse; die Krawatte hat mit einem
Krebsschwanze Ähnlichkeit, und es will mir sogar so vorkommen, als
ob dieser ganze junge Mensch nach Krebssuppe röche. Er ist bei uns
täglich zu Besuch; aber niemand in meiner Familie weiß, von welcher
Herkunft er ist, wo er seine Bildung genossen hat, und wo er die
Mittel zum Leben herbekommt. Er spielt kein Instrument und singt
nicht, hat aber doch eine gewisse Beziehung sowohl zur
Instrumentalmusik als auch zum Gesange; er verkauft irgendwo für
irgend jemand Klaviere, hält sich oft im Konservatorium auf, ist mit
allen Berühmtheiten bekannt und hat bei Konzerten allerlei zu
arrangieren. Er urteilt über Musik mit großer Bestimmtheit, und wie
ich bemerkt habe, schließen sich alle seinem Urteile willig an.
Wie reiche Leute immer ein paar Parasiten um sich haben, so ist
es auch mit der Wissenschaft und mit der Kunst. Es gibt wohl auf
der Welt keine Kunst oder Wissenschaft, die von Fremdkörpern, in
der Art dieses Herrn Gnecker, frei wäre. Ich bin kein Musiker und irre
mich vielleicht hinsichtlich dieses Herrn, den ich zudem nur wenig
kenne; aber die autoritative Würde, mit der er am Flügel steht und
zuhört, wenn jemand singt oder spielt, kommt mir gar zu verdächtig
vor.
Man mag hundertmal ein Gentleman und Geheimrat sein, aber
wenn man eine Tochter hat, so kann man sich durch nichts vor dem
Spießbürgertum sichern, das einem durch die Courmacherei, den
Heiratsantrag und die Hochzeit ins Haus hineingetragen wird und
einem die Stimmung verdirbt. So kann ich mich z. B. schlechterdings
nicht mit der feierlichen Miene abfinden, die meine Frau jedesmal
annimmt, wenn Herr Gnecker bei uns sitzt, auch nicht mit den
Flaschen Lafitte, Portwein und Sherry, die nur seinetwegen auf den
Tisch kommen, um ihn durch den Augenschein zu überzeugen, wie
behaglich und luxuriös wir leben. Ich kann auch Lisas
abgebrochenes Lachen nicht vertragen, das sie sich im
Konservatorium angewöhnt hat, und ihre Manier, die Augen
zusammenzukneifen, wenn Herren bei uns zu Besuch sind. Und vor
allen Dingen kann ich absolut nicht begreifen, warum da tagtäglich
ein Mensch in mein Haus kommt und mit mir zu Mittag speist, der zu
meinen Gewohnheiten, zu meiner Wissenschaft, zu meiner ganzen
Lebensweise nicht im geringsten paßt und mit denjenigen Menschen,
die ich gern habe, nicht die geringste Ähnlichkeit besitzt. Meine Frau
und die Dienerschaft flüstern heimlich, das sei »ein Freiersmann«;
aber ich habe trotzdem kein Verständnis für seine Anwesenheit; sie
erregt bei mir eine solche Verwunderung, als hätte sich ein
Zulukaffer zu mir an den Tisch gesetzt. Und ebenso seltsam kommt
es mir vor, daß meine Tochter, die ich für ein Kind anzusehen
gewohnt bin, diese Krawatte und diese Augen und diese weichen
Backen liebt …
Früher machte das Mittagessen mir Freude oder ließ mich
gleichgültig; aber jetzt erregt es mir nur Langeweile und macht mich
nervös. Seit ich Exzellenz geworden und eine Zeitlang Dekan der
Fakultät gewesen bin, hat meine Familie es aus einem mir
unverständlichen Grunde für nötig befunden, das Menü und die
gesamte Ordnung unseres Mittagessens vollständig umzuändern.
Statt der einfachen Gerichte, an die ich mich gewöhnt hatte, als ich
noch Student und praktischer Arzt war, bekomme ich jetzt eine
Püree-Suppe, in der irgendwelche weiße Klütern schwimmen, und
Nieren in Madeira zu essen. Mein Generalsrang und meine
Berühmtheit haben mich auf immer der Kohlsuppe beraubt und der
schmackhaften Piroggen und des Gänsebratens mit Äpfeln und des
Brassens mit Grütze. Sie haben mich auch des Stubenmädchens
Agascha beraubt, einer geschwätzigen, lachlustigen alten Person,
statt deren jetzt beim Mittagessen Jegor serviert, ein dummer,
hochmütiger Bursche, mit einem weißen Handschuh auf der rechten
Hand. Die Pausen zwischen den Gerichten sind nur kurz, erscheinen
aber außerordentlich lang, weil wir nichts haben, womit wir sie
ausfüllen könnten. Es fehlt die frühere Heiterkeit, die
ungezwungenen Gespräche, die Scherze, das Gelächter, die
gegenseitigen Zärtlichkeiten und jene Freude, die ehemals die Kinder
und meine Frau und ich schon darüber zu empfinden pflegten, daß
wir uns im Eßzimmer zusammenfanden; für mich, einen
vielbeschäftigten Mann, war das Mittagessen eine Zeit der Erholung,
des Wiedersehens mit den Meinen, und für meine Frau und die
Kinder war es eine wenn auch kurze, so doch vergnügte und
fröhliche Feierzeit, wo sie wußten, daß ich für eine halbe Stunde
nicht der Wissenschaft und nicht den Studenten, sondern einzig und
allein ihnen und sonst niemandem gehörte. Jetzt kann ich nicht
mehr das Kunststück ausführen, mich an einem einzigen Gläschen zu
betrinken, und Agascha ist nicht mehr da, und der Brassen mit
Grütze ist nicht mehr da, und auch der Lärm fehlt, der immer die
kleinen aufregenden Ereignisse beim Mittagessen begleitete, wenn z.
B. der Hund und die Katze sich unter dem Tische bissen oder das
Tuch, das sich Katja um die Backe gebunden hatte, ihr in den
Suppenteller fiel.
Die jetzige Mittagsmahlzeit zu schildern ist ebenso unerfreulich wie
sie wirklich durchzumachen. Auf dem Gesichte meiner Frau liegt eine
gewisse Feierlichkeit, eine gekünstelte Würde und der gewöhnliche
sorgenvolle Ausdruck. Unruhig blickt sie auf unsere Teller und sagt:
»Ich sehe, der Braten schmeckt euch nicht. Sagt doch die Wahrheit:
er schmeckt euch wirklich nicht?« Und ich bin dann genötigt zu
antworten: »Du machst dir unnütze Sorge, liebe Frau; der Braten
schmeckt sehr gut.« Und dann sie wieder: »Du willst mich immer
verteidigen, Nikolai Stepanowitsch, und sagst nie, was Du wirklich
denkst. Warum hat denn Alexander Adolfowitsch so wenig
gegessen?« Und in dieser Art geht es während des ganzen
Mittagessens weiter. Lisa lacht in ihrer abgebrochenen Manier und
kneift die Augen zusammen. Ich sehe meine Frau und meine Tochter
an und werde mir gerade jetzt beim Mittagessen vollständig klar
darüber, daß das innere Leben der beiden schon längst meiner
Beobachtung entschlüpft ist. Ich habe ein Gefühl, als hätte ich früher
einmal mit meiner richtigen Familie zu Hause gelebt, wäre aber jetzt
bei einer fremden Dame, nicht bei meiner richtigen Frau, zum
Mittagessen und sähe da ein fremdes junges Mädchen, nicht meine
richtige Lisa, vor mir. Mit beiden ist eine starke Veränderung
vorgegangen, und ich habe diesen langen Veränderungsprozeß
gewissermaßen verschlafen, und so ist es denn kein Wunder, daß ich
jetzt nichts begreife. Wie ist es zu dieser Veränderung gekommen?
Ich weiß es nicht. Möglicherweise rührt das ganze Unglück daher,
daß Gott meiner Frau und meiner Tochter nicht so viel Kraft
verliehen hat wie mir. Ich war von meiner Kindheit an gewöhnt,
äußeren Einflüssen Widerstand zu leisten, und habe mich hinlänglich
abgehärtet; solche Katastrophen im Leben wie das Berühmtwerden,
die Erlangung des Generalsranges, der Übergang von einem
auskömmlichen Leben zu einem Leben, das die Mittel übersteigt, der
Eintritt in den Verkehr mit vornehmen Leuten, und mehr dergleichen,
all das hat mich daher kaum berührt, und ich bin heil und unversehrt
geblieben; aber auf meine Frau und Lisa, die schwach und nicht
abgehärtet waren, ist dies alles zusammengestürzt wie eine große
Schneewand und hat sie erdrückt.
Die jungen Damen und Herr Gnecker reden über Fugen, über
Kontrapunkt, über Sänger und Pianisten, über Bach und Brahms;
meine Frau aber, welche in den Verdacht der Unwissenheit auf
musikalischem Gebiete zu kommen fürchtet, lächelt interessiert und
murmelt: »Ganz reizend … Wirklich? Gewiß, gewiß …« Herr Gnecker
ißt tüchtig, macht wohlanständige Scherze und hört nachsichtig die
Bemerkungen der jungen Damen an. Mitunter bekundet er das
Bestreben, ein schlechtes Französisch zu sprechen, und dann hält er
(ich weiß nicht warum) für nötig, mich votre excellence zu titulieren.
Ich aber bin ärgerlich. Augenscheinlich geniere ich sie alle, und sie
genieren mich. Nie habe ich früher etwas von Feindschaft gegen
einen andern Stand gewußt; jetzt aber quält mich tatsächlich etwas
von dieser Art. Ich bemühe mich, an Herrn Gnecker nur schlechte
Eigenschaften herauszufinden, finde solche auch wirklich bald und
bin mißgestimmt darüber, daß da als Bewerber um die Hand meiner
Tochter ein Mensch sitzt, der einem ganz andern Kreise angehört als
ich. Seine Anwesenheit hat auch noch in einer andern Hinsicht einen
schlechten Einfluß auf mich. Gewöhnlich, wenn ich allein bin oder
mich in Gesellschaft von Leuten befinde, die mir sympathisch sind,
denke ich gar nicht an meine Verdienste, oder wenn mir doch der
Gedanke an sie kommt, so erscheinen sie mir so geringfügig, als
wäre ich erst gestern ein Gelehrter geworden; aber in Gegenwart
solcher Leute, wie Herr Gnecker, kommen mir meine Verdienste wie
ein sehr hoher Berg vor, dessen Gipfel in den Wolken verschwindet,
und an dessen Fuße, für das Auge kaum sichtbar, die Menschen von
der Art des Herrn Gnecker sich herumbewegen.
Nach Tische gehe ich in mein Arbeitszimmer und rauche dort ein
Pfeifchen, das einzige während des ganzen Tages; mehr ist von
meiner früheren schlechten Gewohnheit, vom frühen Morgen bis in
die Nacht hinein zu paffen, nicht übriggeblieben. Während ich
rauche, kommt meine Frau zu mir herein und setzt sich hin, um mit
mir zu reden. Gerade so wie am Vormittage weiß ich auch jetzt,
wovon unser Gespräch handeln wird.
»Ich habe mit dir etwas Ernstes zu besprechen, Nikolai
Stepanowitsch,« beginnt sie. »Ich wollte von Lisa reden. Warum
wendest du darauf keine Aufmerksamkeit?«
»Was meinst du damit?«
»Du tust, als ob du nichts merktest; aber das ist doch ein falsches
Benehmen. Man darf die Sache nicht so gehen lassen, ohne sich
darum zu kümmern. Gnecker hat ernste Absichten auf Lisa. Was
sagst du dazu?«
»Daß er ein schlechter Mensch ist, kann ich nicht sagen, da ich ihn
nicht kenne; aber daß er mir nicht gefällt, habe ich dir schon
tausendmal gesagt.«
»Aber es ist unrecht … es ist unrecht …«
Sie steht auf und geht in großer Erregung auf und ab.
»Es ist unrecht, einer ernsten Sache gegenüber einen solchen
Standpunkt einzunehmen,« sagt sie. »Wenn es sich um das
Lebensglück der Tochter handelt, dann muß man alles Persönliche
ausschalten. Ich weiß, daß er dir nicht gefällt … Das kann ja sein …
Aber wenn wir ihn jetzt abweisen und die Sache verhindern, dann ist
zu befürchten, daß Lisa uns ihr ganzes Leben lang Vorwürfe machen
wird. Es wimmelt heutzutage nicht von Freiern, und es kann leicht
kommen, daß sich ihr keine andere Partie mehr bietet. Er liebt Lisa
sehr, und anscheinend findet auch sie an ihm Gefallen. Er hat ja
allerdings keine gesicherte Stellung; aber was ist da zu machen? So
Gott will, wird er schon mit der Zeit irgendwo ankommen. Er ist aus
guter Familie und reich.«
»Woher weißt du das?«
»Er hat es gesagt. Sein Vater besitzt in Charkow ein großes Haus
und in der Nähe von Charkow ein Gut. Kurz gesagt, Nikolai
Stepanowitsch, du mußt unbedingt nach Charkow reisen.«
»Warum?«
»Du mußt da Erkundigungen anstellen. Du bist ja dort mit einigen
Professoren bekannt; die werden dir behilflich sein. Ich würde selbst
hinfahren; aber ich bin ein Weib. Ich kann es nicht.«
»Ich reise nicht nach Charkow,« erwidere ich mürrisch.
Meine Frau bekommt einen Schreck, und auf ihrem Gesichte
erscheint ein Ausdruck qualvollen Schmerzes.
»Um Gottes willen, Nikolai Stepanowitsch!« fleht sie mich
schluchzend an. »Um Gottes willen, nimm mir diese schwere Sorge
von der Seele! Ich leide darunter entsetzlich!«
Wie ich sie so ansehe, tut sie mir leid.
»Nun gut, Warja,« sage ich freundlich. »Wenn du es wünschest,
will ich meinetwegen nach Charkow fahren und alles tun, was du
möchtest.«
Sie drückt das Taschentuch gegen die Augen und geht auf ihr
Zimmer, um zu weinen. Ich bleibe allein.
Nach einiger Zeit bringt man mir Licht. Von den Sesseln und dem
Lampenschirm lagern sich auf den Wänden und auf dem Fußboden
die mir längst bekannten, längst zuwider gewordenen Schatten, und
wenn ich sie ansehe, so will es mir scheinen, daß es schon Nacht
sei, und daß meine nichtswürdige Schlaflosigkeit schon beginne. Ich
lege mich ins Bett; dann stehe ich wieder auf und wandere im
Zimmer auf und ab; dann lege ich mich wieder hin … Gewöhnlich
erreicht nach dem Mittagessen, vor dem Abend, meine nervöse
Erregung ihren höchsten Grad. Ich fange ohne Veranlassung zu
weinen an und stecke den Kopf unter das Kopfkissen. In solchen
Augenblicken fürchte ich mich davor, daß jemand eintreten könnte;
ich fürchte, plötzlich zu sterben, schäme mich meiner Tränen, und
meine ganze Seele ist von einem allgemeinen, unerträglichen
Schmerz erfüllt. Ich fühle, daß ich nicht länger imstande bin, meine
Lampe, meine Bücher, die Schatten auf dem Fußboden anzusehen
und die aus dem Salon herübertönenden Stimmen anzuhören. Eine
unsichtbare, unbegreifliche Macht zieht mich gewaltsam aus meiner
Wohnung hinaus. Ich springe auf, kleide mich hastig an und gehe
vorsichtig, damit meine Hausgenossen es nicht gewahr werden, auf
die Straße. Wo soll ich hingehen?
Die Antwort auf diese Frage steckt schon längst fertig in meinem
Gehirn: zu Katja.
III
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com