|
|
| Preface |
This book is aimed at programmers who wish to learn the object-oriented language C++. A knowledge of C, the ancestral language of C++, is not a requirement, as the book assumes no previous knowledge of this language.
The first chapter looks at an object-oriented view of programming. The next two chapters concentrate on the basic data and control structures in the language. The book then moves on to discuss the object-oriented features of the language, using numerous examples to illustrate the ideas of encapsulation, inheritance, and polymorphism. In illustrating these ideas, the discussion is initially restricted to the high level features of the language. By using appropriate constructs, such as the string class, the need to use low-level facilities in the language is avoided.
In Chapter 12 a case study in the design and implementation of a board game is used to illustrate the concepts and techniques explored in the earlier chapters of the book. This chapter takes the reader from the initial ideas about the problem, through the design process, to the eventual implementation of a program to play the game between two human players.
After these fundamental issues in program construction have been explored, the book then examines the low level features of the C++ language, in particular those concerned with pointers and address arithmetic. The introduction to the use of pointers and address arithmetic is deliberately deferred until the later chapters of the book, in order to encourage users of the language to employ these features only when building classes which implement higher level constructs.
The Standard Template Library is explored with a chapter on the use and implementation of generic algorithms and a chapter on the use of the standard containers.
The book concludes with chapters on the attributes of a C++ program, and a summary of the important constructs in the language. Self-assessment questions and exercises are suggested for the reader at the end of each chapter.
I would in particular like to thank Corinna, my wife, for putting up with my many long hours in the ‘computer room’ and her many useful suggestions on the presentation and style used for the material in this book.
Website:
Support material for the book can be found on the Author's website, http://www.mcgraw-hill.co.uk/smithma (Direct line is: http://www.brighton.ac.uk/cpp.) The material consists of further solutions, source code, artwork and general information about Java. Further exercises may be obtained by tutors, who may contact the Author, by email.
Changes from the first edition
The general structure of the book has been retained from the first edition. However, a substantial amount of new material has been included to cover additions made to C++ in the ANSI C++ standard. Additionally, most of the original code examples have been re-worked to take advantage of features in ANSI C++
Michael A. Smith Brighton,
March 1999
M.A.Smith at brighton dot ac dot uk