数组

c++数组主要包括静态数组,动态数组,vector

1. 静态数组

  • 未初始化的数组是随机数据,初始化方法有
int arr[1024] = {0};        //全部初始化为0
int arr[1024] = {1};        //第一个元素为1,其他为0