网页提示正确但是输出却没结果?
#include <stdio.h>
int main()
{
//第一种形式
int arrFirst[3] = {1,2,3};
//第二种形式
int arrSecond[] = {1,2,3};
//第三种形式
int arrThird[3];
//给arrThird数组每个元素初始化
int arrThird[0] = 1;
int arrThird[1] = 2;
int arrThird[2] = 3;
//输出第一个数组中的第二个元素
printf("%d\n", arrFirst[1]);
//输出第二个数组中的第二个元素
printf("%d\n", arrSecond[1]);
//输出第三个数组中的第二个元素
printf("%d\n", arrThird[1]);
return 0;
}
这是我的代码,然后输出是这样的:
hello.c: In function 'main':
hello.c:11:9: error: conflicting types for 'arrThird'
int arrThird[0] = 1;
^
hello.c:9:9: note: previous declaration of 'arrThird' was here
int arrThird[3];
^
hello.c:11:5: error: invalid initializer
int arrThird[0] = 1;
^
hello.c:12:9: error: conflicting types for 'arrThird'
int arrThird[1] = 2;
^
hello.c:11:9: note: previous definition of 'arrThird' was here
int arrThird[0] = 1;
^
hello.c:12:5: error: invalid initializer
int arrThird[1] = 2;
^
hello.c:13:9: error: conflicting types for 'arrThird'
int arrThird[2] = 3;
^
hello.c:12:9: note: previous definition of 'arrThird' was here
int arrThird[1] = 2;
^
hello.c:13:5: error: invalid initializer
int arrThird[2] = 3;
^
这是怎么回事?是我的代码整个都错了吗