Essential C + + Chinese preface __c++

Source: Internet
Author: User
Tags exception handling microsoft c

God, this book is so thin and short. I really want to shout "wow". C++primer plus index, title page, opens after, thick up to 1237 pages, and this book is only a thin 276 pages. Boxing term, this is a "lightweight" work.

Everyone will wonder what's going on. It is true that there is a story inside.

For the past few years, I've been pestering everyone in the Disney film Animation Company (Disney Feature Animation) to ask me to take part in the production of a film. I pestered the director and even Mickey myself (if I could say it) and asked for a management job. I'm going to be so crazy, in part because I'm stuck in the endless magic of the big Hollywood screens. In addition to my degree in computer science, I also have the title of Master of Arts, and film work seems to bring me some sort of integration of personal expertise. I asked for management work to gain experience from the production process in order to provide practical and useful tools. As a C + + compiler writer, I have always been one of my most important users. And you know, when you're the main gripe of your own software, it's hard to defend yourself or feel unfairly blamed.

"Fantasia 2000" (Fantasia2000) has a special effect lens of a fire bird (Firebird) in the film. Its computer special effects guide is interested in my joining. However, in order to weigh my weight, he asked me to write a tool to read the original data for a given scene, and then to create a camera node (Cameranode) that could be embedded in the Houdini animation suite. Of course, I used C + + to get it done well. They loved it and I got the job I dreamed of.

Once, in the production process (thanks in particular to Jinko and Chyuan), I was asked to rewrite the tool in Perl. Other TD is not a master programmer, just know the Perl, TCL and other programming languages. (TD is the term of the film industry, referring to the technical director.) I am the software TD of this film, we also have a light td(hello, mira), a model td(Hello, Tim), and film special effects animators (Hello, mike,steve,tonya). And, Oh, my God, I have to catch up, because we want to get some empirical evidence, and the director (Hello, Paul and Gaetan) and special effects director (Hello, Dave) are waiting for the results to be presented to the company's big Boss (Hello, Peter). It's not an urgent task, but, you know ..., alas.

This makes me feel a bit embarrassed. I'm confident I can do it quickly in C + +, but I don't know Perl. Well, I think I'm going to find a book to hold cramming--if the book isn't too thick, at least not too thick at the moment. And it's better not to tell me too many things, although I know I should know everything, but wait for a while. After all, it's just a show: the directors need some proven concepts, and the artist needs something to help validate the concept, and the producer (Hello, heck) needs 48 hours a day. I don't need the best perl in the world right now, what I need is a little book that will lead me properly and keep me from going too far.

I found Randalschwartz's learning Perl, which gave me a quick start and a very interesting reading. But like other interesting computer books, it also omits a lot of what's worth reading-though at that point I don't need to know everything, I just need to get my Perl program to move.

I finally understand in the sentimental state of mind, C + + Primer Third Edition can not play people in the beginner C + + tutor role. It's too big. Of course, I still think it's a masterpiece that I'm proud of--especially since the invitation to Josée Lajoie together. But for those who want to learn C + + programming language right away, this masterpiece is too big and complex. This is the origin of this book.

You might think that C + + is not perl. Absolutely right. This book is also not Learningperl, it talks about how to learn C + +. The real question is, who is able to claim to have taught all things after the pages have been scattered?

1. Fine degree. In the field of computer graphics, precision refers to the degree to which the image is depicted. The Huns on horseback in the upper left corner of the screen need a clear eye face, hair, five o'clock shadow, clothes .... Behind the Huns--no, not that rock, God--well, it doesn't matter. So we do not depict the two images in the same fineness. By the same token, the fineness of this book has been reduced to a considerable extent. In my opinion, C + + Primer is extremely complete except for an instance of operator overloading (operatoroverloading), which I dare say is because Josée also has a credit. But still, C + + Primer has spent 46 pages discussing operator overloading, with examples attached, and this book is only two pages across.

2. Language core. When I was a c++report editor, I used to say that half of the work of a magazine editor was spent deciding which subjects to put and what not. This sentence is as true as the book. The content of this book is organized around a series of problems that occur during the programming process. I introduce the characteristics of the programming language itself to provide solutions to different problems. The book does not address any problem that can be solved by multiple inheritance or virtual inheritance, so I have not discussed these two topics at all. However, in order to implement iterator class, I must introduce a nested type (NestedType). Class type conversion operators are easy to use incorrectly and are complicated to explain, so I'm not going to mention it in the book. Such. My choice of subject matter and the order of presentation of language characteristics are welcome to criticize. This is my choice and my duty.

3. Number of examples. C++primer has hundreds of pages of code, including a set of object-oriented (object oriented) text retrieval system, and 10 or so complete class. Although the book also has code, but the number is far less than C + + Primer. To make up for this shortcoming, I have put all the exercise answers in Appendix A. As my editor Deborah Lafferty said, "If you want to improve your teaching speed, the easy answers are very helpful to the reinforcement of learning." ”

Structure and organization

This book is composed of seven chapters and two appendices. The 1th chapter depicts a predefined part of the C + + language by writing a small program with an interactive nature. This chapter covers the built-in data types, language-predefined operators (operator), vectors and strings in standard libraries, conditional statements and loop statements, and iostream libraries for input and output. I introduce vector and string two classes in this chapter because I want to encourage readers to use them instead of the built-in array (array) and C-style strings in the language.

The 2nd chapter explains the design and use of functions, and looks at the various features of C + + functions, including inline functions, overload (over loaded) functions, functiontemplate, and function pointers (pointers to functions).

The 3rd chapter covers the so-called standard Template Library (STL): A set of container classes (including vectors, lists, sets, maps, and so on), a set of generic algorithms acting on the container (including sort (), copy (), merge (), etc.). Appendix B lists the most widely used generic algorithms in dictionary order, with an example attached.

As a C + + programmer, your main task is to submit class and the Object-oriented class hierarchy. The 4th chapter will lead you to understand the class mechanism design and use process. In this process, you will see how to create a proprietary data type for your application system. The 5th chapter introduces how to extend class, so that multiple related classes form clan system, and support object-oriented class hierarchy. As an example of my experience as a consultant at DreamWorks Animation Studios (Dreamworks Animation), we designed some class for four channels of image synthesis. We used inheritance and dynamic binding technology to define the class hierarchy required for image synthesis, not just the design of eight separate classes.

The play of the 6th chapter is class template, which is a first description of the class, allowing us to extract and parameterize one or more data types or data values used by class. Vector as an example, it may be necessary to parameterize the type of its elements, and the design of buffer not only to the element type parameterization, but also the buffer capacity of the parameterization. The route of this chapter revolves around the realization of the classtemplate of the binary tree (binary).

The last chapter, the 7th chapter, describes how to use the exception handling mechanism of C + + (Exception handlingfacility) and demonstrates how to incorporate it into the exception system defined by the standard library. Appendix A is the answer to this book's exercise. Appendix B provides a discussion and usages of some of the most widely used generic algorithms.

About source code

All the procedures in this book, as well as the complete code in the exercise solution, are available online. You can get it from the Addison Wesley Longman website (www.awl.com/cseng/titles/0-201-48518-4) or my Personal home page (www.objectwrite.com). All programs were tested in the Visualc++ 5.0 environment with the Intel C + + compiler and tested in the Visualc++ 6.0 environment with the Microsoft C + + compiler. You may need to modify the code a little bit to compile successfully on your own system. If you need to make some changes and do so, please send me the result of the change (slippman@objectwrite.com), I will attach your name, attached to the exercise answer code. Please note that this book does not show all the code.

Thanks

In particular, I would like to thank C++primer, the co-author of the third edition of Josée Lajoie. Not only did she give me a lot of insight into the first draft of the book, but also because she was constantly inspiring me in the back. I would also like to thank Dave Slayton for his incisive Green pencil, which thoroughly reviews the text and program examples. Steve Vinoski, in a sympathetic but resolute tone, provided a lot of valuable advice for the first draft of the book.

Special thanks to Addison-wesley Editorial team: The Whole book editor Deborah Lafferty support the project from beginning to end; The reviewer editor Besty Hardinger contributed the most to the readability of the text; Product manager John Fuller Lead us to a whole bunch of documents into a complete book.

In the process of writing this book, I also worked as an independent consultant, so I had to take care of both the manuscript and the client. Thank my clients for being so considerate and tolerant to me. I would like to thank Colin Lipworth, Edwinleonard, Kenneth Meyer, for your patience and trust, the book was completed.

More readings

I would recommend the two best books in C + +, that is, the c++primer of Lippman and Lajoie, and Stroustrup's works thec++ programming. Both of these books are currently in the 3rd edition. I will provide more in-depth bibliography in the various topics of this book. The following is a bibliography of the book. (You can find a wider range of references in C + + Primer and thec++ programming Language.) )

[LIPPMAN98] Lippman,stanley and Josée Lajoie, C + + Primer, 3rd editoin, Addison Wesley longman,inc.,reading, MA (1998) ISBN 0-201-82470 -1.

[LIPPMAN96A] Lippman,stanley, Inside the C + + Object Model, Addison Wesley Longman, Inc., Reading,ma (1996) ISBN 0-201-83454-5.

[lippman96b] Lippman,stanley, Editor, C + + Gems, a SIGS books imprint, Cambridge Universitypress,cambridge, England (1996) ISBN 0-135705 81-9.

[STROUSTRUP97] Stroustrup, Bjarne, the C + + programming Language, 3rd Editoin, Addison Wesleylongman, Inc., Reading, MA (1997) ISBN 0-201- 88954-4.

[SUTTER99] Sutter, Herb, exceptional C++,addison Wesley Longman, Inc., Reading, MA (Watts) ISBN 0-201-61562-2.

This article extracts from "Essential C + + Chinese version" a book

[Mei] Stanley B.lippman
Houtie translation

Publishing Industry Publishing House

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.