Array是固定大小的容器,定义时要显式的指定大小。
可以修改array中元素的值,但不能向array中插入和删除元素.
array在栈上为元素分配内存。
array<TYPE, SIZE>
swap(arr1,arr2); //具有线性时间复杂度
arr1.swap(arr2);
.fill(VALUE) //填充值
.size()
Iterators
- begin
- Return iterator to beginning (public member function )
- end
- Return iterator to end (public member function )
- rbegin
- Return reverse iterator to reverse beginning (public member function )
- rend
- Return reverse iterator to reverse end (public member function )
- cbegin
- Return const_iterator to beginning (public member function )
- cend
- Return const_iterator to end (public member function )
- crbegin
- Return const_reverse_iterator to reverse beginning (public member function )
- crend
- Return const_reverse_iterator to reverse end (public member function )
for ( auto rit=myarray.crbegin() ; rit < myarray.crend(); ++rit )
来源:https://www.cnblogs.com/tomatokely/p/8986857.html