cbxg135

#include<stdio.h>
int main(){
//1.定义数组
// int a[2*2];
// int b =2;
// int c[2*b];//b是变量 []里面只能放整型常量 或常量表达式error
const int b=2;
int c[2*b];
//int e[3.1] error
int e[(int)3.1];
int f[\'A\'];
int g[true];
//2.定义并初始化数组
//完全初始化
// int a[4]={1,2,3,4};
// int a[]={1,2,3,4,};
int a[4] = {1};//在不完全初始化中,元素如果未被初始化将会有一个默认值0
for(int i=0;i<4;++i){
printf("%d\n",a[i]);
return 0;
}

}

分类:

技术点:

相关文章:

  • 2021-10-23
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-05-28
  • 2021-11-05
  • 2021-11-28
相关资源
相似解决方案