询问一个问题(关于矩阵,)用的是递归,却不知道为什么不能编译出来
题目的样子是这样的:1 2 3 4 5
16 17 18 19 6
15 24 25 20 7
14 23 22 21 8
13 12 11 10 9
#include<stdio.h>
#include<stdlib.h>
#define size 4
typedef struct comeover{
int a[size][size];
}justdoit;
int main()
{
justdoit a;
int i,j;
justdoit urbeauty(justdoit , int );
a=urbeauty(a,size);
for(i=0;i<=size;i++)
for(j=0;j<=size;j++)
》》》》》 printf("%2d",a[i][j]);
return EXIT_SUCCESS;
}
justdoit urbeauty(justdoit a,int n)
{
int i,j,b,c,d;
static k=1;
if(n>1)
{
for(i=0;i<size;i++);
switch (i){
case 0:
for(j=size-n;j<=n;j++)
》》》》 a[size-n][j]=k++;
break;
case 1 :
for(j=n,b=size-n+1;b<=n;b++)
》》》》》》》 a[b][j]=k++;
break;
case 2 :
for(c=n,j=size-n+1;j<=n;j++)
》》》》》 a[c][size-j]=k++;
break;
case 3 :
for(j=size-n,d=size-n+1;d<=n;d++)
》》》》》》》》 a[size-d+1][size-n]=k++;
break;
}
urbeauty(a,n-1);
}return a;
}
问题出现,我用》》》》表示,
F:\编程艺术#、\环绕矩阵。\矩阵。.cpp(15) : error C2676: binary '[' : 'struct comeover' does not define this operator or a conversion to a type acceptable to the predefined operator
F:\编程艺术#、\环绕矩阵。\矩阵。.cpp(28) : error C2676: binary '[' : 'struct comeover' does not define this operator or a conversion to a type acceptable to the predefined operator
F:\编程艺术#、\环绕矩阵。\矩阵。.cpp(32) : error C2676: binary '[' : 'struct comeover' does not define this operator or a conversion to a type acceptable to the predefined operator
F:\编程艺术#、\环绕矩阵。\矩阵。.cpp(36) : error C2676: binary '[' : 'struct comeover' does not define this operator or a conversion to a type acceptable to the predefined operator
F:\编程艺术#、\环绕矩阵。\矩阵。.cpp(40) : error C2676: binary '[' : 'struct comeover' does not define this operator or a conversion to a type acceptable to the predefined operator
请问这是怎么回事,请高手指点指点,谢谢。