Skip to main content

1994 | Buch

Programming in C++

verfasst von: Jean Ettinger, MSc CEng

Verlag: Macmillan Education UK

Buchreihe : Computer Science Series

insite
SUCHEN

Inhaltsverzeichnis

Frontmatter
1. The inheritance of C++
Abstract
C++ is a recent programming language developed to exploit some of the latest software engineering methodologies that aim to make software easier to develop, easier to enlarge, and as reliable as possible. It is an enhanced and extended form of one of the major structured, imperative, languages, C, using features first found in related languages such as Simula, Pascal, and Ada, and features found in object-oriented programming languages.
Jean Ettinger
2. Simple programs, and the predefined data types
Abstract
We first consider simple programs that demonstrate how the iostream library is used to output text strings, and to input and output whole numbers and numbers with fractional parts.
Jean Ettinger
3. Structured programming
Abstract
Languages that enable the development of programs using the structured programming methodology provide a set of structure statements, so that choices can be made about which sequence of statements are to be executed and so that sequences of statements can be repeated. These structure statements are used for selection (alternation, choice), and repetition (iteration, looping).
Jean Ettinger
4. Derived types
Abstract
This chapter discusses types that can be derived from the predefined types (and, as we shall see, most of them can be derived from classes as well). These types are the pointer type, the reference type, the array type, and the struct type. We consider, as well, the useful simple derived types of strings and enumerated constants.
Jean Ettinger
5. Functions
Abstract
One of the most fundamental ideas in problem solving, and for developing an algorithm to obtain a solution, is to divide a problem into smaller subproblems each independent of other subproblems, solve each of the subproblems and hence solve the original problem.
Jean Ettinger
6. Data files and library files
Abstract
We have entered our programs, using a keyboard and an editor, as text files: as streams of (ASCII) bytes. Any text entered using editors or word-processors will be stored as text files. We can use an editor to create text data files. We first consider, in this chapter, extracting (and inserting) data objects from (and to) data file streams.
Jean Ettinger
7. Classes and derived classes
Abstract
We have seen how to define and declare one data object as an abstract data structure. It would be more interesting to be able to define an abstract data structure so that any number of objects could be declared with this structure.
Jean Ettinger
8. Overloading and friends
Abstract
Both functions and operators can be overloaded in C++. This means that several definitions can be associated with a function identifier or with most operator symbols.
Jean Ettinger
9. Dynamic memory allocation
Abstract
So far, we have had to make requests for the maximum storage requirements for objects using their type or class defmitions. This chapter shows how storage, of just the right size, can be allocated at run-time. These objects have dynamic duration; they can be allocated storage, and subsequently have the storage deallocated anywhere in a program.
Jean Ettinger
10. Templates
Abstract
C + + is, in many respects, a strongly-typed language. In particular, as we have seen, a C+ + compiler chooses which function definition to bind to the code from consideration of the actual argument types and classes associated with a call when an overloaded function identifier is used. This means that a separate definition is required for all the possible argument types1 that a program may require to be associated with that function identifier.
Jean Ettinger
11. Virtual functions and virtual base classes
Abstract
This chapter shows how the rules governing inheritance between a base class and derived classes are extended in C + + to enable the object-oriented programming concept of polymorphism. Languages implementing this concept permit objects of different classes to respond to a message in different ways.
Jean Ettinger
Backmatter
Metadaten
Titel
Programming in C++
verfasst von
Jean Ettinger, MSc CEng
Copyright-Jahr
1994
Verlag
Macmillan Education UK
Electronic ISBN
978-1-349-23304-5
Print ISBN
978-0-333-60682-7
DOI
https://doi.org/10.1007/978-1-349-23304-5