"C ++ Primer" reading notes 11

zhaozj2021-02-16  71

Note: 2.8

From this chapter, we have been moving forward along a main line. Follow the author designed a relatively complete Array class, from the design point of view, (Of course, in addition to the realizes of the library), we don't have to spend so much time in achieving data Structure, as long as we call various libraries, we can put our own energy in more important design. In today, for the use of libraries, almost one of the important indicators of programming capabilities, as an initiator, first Of course, it is a standard library that has been integrated with the language, and in all data structures, the most undoubtedly used linear table. The standard library description of this book is of course starting here,

This section is the easiest, and the general usage of Vector and the built-in array have little difference. The beginners are easy to understand, of course, individuals think. If you look at it carefully, there is something worth noting and thinking, below it:

I. Design concept of the standard library. As the author mentioned: Vector is not to provide a large and full method collection like Array in the previous few sections, but provides a smallest interface collection, which makes the generic algorithm for generic methods. It can be used in various data structures. This thought just reflects the author's issues raised in this chapter, designing a class, it is to try to make him a language of the language, rather than designing an face.

II. For the initial understanding of Iterator, this may be the only difficult point in this section, iterator? Many beginners don't understand this unfamiliar terminology. But he is almost the foundation of this generic algorithm, so we are now at least for some preliminary understanding to ensure the following reading. In order to achieve this, we have read the examples in the book, it is not difficult to find him with the pointer. The usage is almost identical. So in fact, you can treat him as a kind of template for the pointer. When you read the 15th chapter overload ->, you can understand the benefits of this, there are some special Iterator, such as Begin. .). Nend (). There is a detailed explanation on the book, take a closer look, my suggestion is not to know, but at least it will imitate.

This chapter is over, we also have a more comprehensive understanding for C . Below I want some suggestions for some friends, make a simple answer, until now I wrote, some people are all I know, as a real note is Rosoto, as the purpose of these two chapters wants to let beginners have a language overall understanding, my fundamental purpose of these notes is also as possible to begin a beginner C friend. This good book, and let everyone get used to the description of the author's description, so I commented on something other than books, comparison, so that this book is recommended. As a student, I have all educators (such as

Tan Haoqiang

Teacher) is respectful. But this book is indeed better than they write.

From the following sections, let not return to the original look. I no longer write him in strict accordance with the section. After all, I have already read this book. I will be based on the specific content. Combine the relevant content mentioned before and after the book and write my own complete understanding. Of course, this will expose more questions. I hope everyone will give me more guidance, thank you for your support, especially drinking water, Shui Tsinghua and Fudan Guanghua Station friends.

转载请注明原文地址:https://www.9cbs.com/read-15798.html

New Post(0)