array::crbegin
傳回 Iterator const 至反向的陣列的第一個項目。
const_reverse_iterator crbegin( ) const;
傳回值
解決 const 相反隨機存取 Iterator 說明一個反向的陣列的第一個項目或功能在此 unreversed 陣列的最後一個項目。
備註
crbegin的傳回值,因此無法修改陣列物件。
範例
// array_crbegin.cpp
// compile with: /EHsc
#include <array>
#include <iostream>
int main( )
{
using namespace std;
array<int, 2> v1 = {1, 2};
array<int, 2>::iterator v1_Iter;
array<int, 2>::const_reverse_iterator v1_rIter;
v1_Iter = v1.begin( );
cout << "The first element of array is "
<< *v1_Iter << "." << endl;
v1_rIter = v1.crbegin( );
cout << "The first element of the reversed array is "
<< *v1_rIter << "." << endl;
}
需求
標題: <array>
命名空間: std