数组

https://www.cnblogs.com/chenyangyao/p/5222696.html

https://www.cnblogs.com/haoyijing/p/5815035.html

https://blog.csdn.net/u014417133/article/details/77185009/

1、初始化

1)https://www.cnblogs.com/haoyijing/p/5815035.html

2)数组初始化列表中的元素个数小于指定的数组长度时,不足的元素补以默认值;

int a[5] = { 1 };//仅仅a[0]=1;

int a[5]={0};//全是0;

3)初始化为0;没()的话就不会初始化;

int* a = new int[5]();

4)string* a = new string[5] { "foo" }

2、数组与指针

int a[3][2];  int (*b)[2]=a;  int *p=a[0];  int (*f)[3][2]=&a;

https://www.cnblogs.com/chenyangyao/p/5222696.html

3、迭代方式

1) int *beg = begin(ia) //返回首元素指针; int *last=end(ia)// 返回尾元素的下一个位置的指针

for( int *p = begin(ia); p != end(ia); p++ )  { }

2) for( int *b = arr; b !=&arr[n]; ++b ) { };

3) for( int i = 0; b < sizeof( arr ) / sizeof( arr[0] ); ++b ) { }

原文地址:https://www.cnblogs.com/wllwqdeai/p/10686409.html