第一种方法:直接定义内容不用专门定义长度; 第二种方法: 先定义长度再定义内容 数组的输出:遍历输出数组的值 输出结果: age[0]=1 age[1]=2 age[2]=3 age[3]=4 age[4]=5 age[5]=6 Process finished with exit code 0 原文链接: https://blog.csdn.net/daibadetianshi/article/details/136603560