//int arr[] = {0,1,2,3,4};
//int* b = begin(arr);//获取数组的首地址
//int* e = end(arr);//获取数组的最后一个元素的下一位的地址
#include <iostream>
using namespace std;
int main()
{
int arr[] = {0,1,2,3,4,5,6};
cout<<"arr = "<<arr<<endl;
cout<<"arr[0] = "<<&arr[0]<<endl;
cout<<"begin = "<<begin(arr)<<endl;
cout<<"arr[6] = "<<&arr[6]<<endl;
cout<<"arr[7] = "<<&arr[7]<<endl;
cout<<"end = "<<end(arr)<<endl;
return 0;
}
C++的标准库的函数,begin,end
最新推荐文章于 2024-06-02 15:13:12 发布