原来在C++中还能这样求数组长度#include<iostream>using namespace std;int main(){ int nums[10]={1,2,3,4,5,6,7,8,9,10}; cout<<"nums数组的长度为:"<<end(nums)-begin(nums);}