70,037
社区成员
发帖
与我相关
我的任务
分享
#define LIMIT 2
const int LIM = 3;
static int data1[LIMIT]; //合法
static int data2[LIM];//无效
const int LIM2 = 2 * LIMIT;//合法
const int LIM3 = 2 * LIM;//无效
#include<stdio.h>
#define LIMIT 2
const int LIM = 3;
int main(){
static int data1[LIMIT] = {1,2};
static int data2[LIM]={1,2,3};
const int LIM2 = 2 * LIMIT;
const int LIM3 = 2 * LIM;
printf("%d %d\n", LIM2, LIM3);
for(int i = 0;i < 2; i++)
printf("%d ", data1[i]);
printf("\n");
for(int i = 0; i < 3; i++)
printf("%d ", data2[i]);
printf("\n");
return 0;
}
const int LEN = 100;
char str[LEN + 1];