- 相關(guān)推薦
《泛型編程與STL》讀后感1--持續(xù)更新中
《泛型編程與STL》學(xué)習(xí)感悟 1在C語言中有3種不同類型的指針:<1>普通而且有效的指針。比如&A[0];<2>非法指針,比如NULL<3>"past-the-end"指針,我們不能對其進行提領(lǐng)動作,但是可以用于指針運算。比如int A[10];我們不能用&A[10]. 2 雖然我們可以對于迭代器Iterator進行提領(lǐng)運算。但是這個并不能說明Iterator是一個指針。而僅僅是說明Iterator必須支持類似指針的接口。 3 operator++中。如果是operator++() 則說明是前++,如果是operator++(int ),則是后++、 4 Input Iterator并不能提供更改【iterator所指之物】的方法、也就是說具有只讀性。但是output iterator只具有只寫性。并且用這兩個迭代器的算法只能是“單回的”。任何時候任何區(qū)間只能有一個Input Iterator或者output iterator有效的迭代器。其他的迭代器具體的描述如下: Iterator Description input_iterator Read values with forward movement. These can be incremented, compared, and dereferenced. output_iterator Write values with forward movement. These can be incremented and dereferenced. forward_iterator Read or write values with forward movement. These combine the functionality of input and output iterators with the ability to store the iterators value. bidirectional_iterator Read and write values with forward and backward movement. These are like the forward iterators, but you can increment and decrement them. random_iterator Read and write values with random access. These are the most powerful iterators, combining the functionality of bidirectional iterators with the ability to do pointer arithmetic and pointer comparisons. reverse_iterator Either a random iterator or a bidirectional iterator that moves in reverse direction. Each of the container classes is associated with a type of iterator, and each of the STL algorithms uses a certain type of iterator. For example, vectors are associated with random-access iterators, which means that they can use algorithms that require random access. Since random-access iterators encompass all of the characteristics of the other iterators, vectors can use algorithms designed for other iterators as well.【《泛型編程與STL》讀后感1--持續(xù)更新中】相關(guān)文章:
編程的心得03-14
和尹從事懋泛洞庭,和尹從事懋泛洞庭張說,和尹從事懋泛洞庭的意思,和尹從事懋泛洞庭賞析 -詩詞大全03-13
數(shù)控編程心得05-07
臨泛東湖(時任洪州),臨泛東湖(時任洪州)張九齡,臨泛東湖(時任洪州)的意思,臨泛東湖(時任洪州)賞析 -詩詞大全03-13
東湖臨泛餞王司馬,東湖臨泛餞王司馬張九齡,東湖臨泛餞王司馬的意思,東湖臨泛餞王司馬賞析 -詩詞大全03-13
《步步驚心》讀后感之1--十四阿哥04-27
有趣的編程課作文04-20
泛吳松江閱讀答案翻譯賞析12-20
女友道歉信更新01-22