struct cursor
{
int row;
int line;
struct matrix* p;
int status;
};
struct row
{
int no;
struct matrix* p;
int summation;
int status;
};
struct line
{
int no;
struct matrix* p;
int summation;
int status;
};
struct matrix* initialize(int h,int w);
int display(struct matrix* handle);
int release(struct matrix* handle);
int cursor_l(struct cursor* handle);
int cursor_r(struct cursor* handle);
int cursor_u(struct cursor* handle);
int cursor_d(struct cursor* handle);
int main(int argc, char* argv[])
{
int h,w,i,c;
struct matrix* handle;
printf("Please input the height of Matrix!\n");
scanf("%d",&h);
printf("Please input the width of Matrix!\n");
scanf("%d",&w);
if(h==1&&w==1)
{
printf("The Height or Width is illegal!\n");
return 1;
}
printf("Initializing the Matrix");
handle=initialize(h,w);
while(i!=0)
{
printf("\nPlease select the function:\n\n");
printf("1.Display the Matrix\n");
printf("2.Function II\n");
printf("3.Function III\n");
printf("4.Function IV\n");
printf("5.Exit\n");
printf("\n\n\nSlect:");
scanf("%d",&c);
switch(c)
{
case 1:
display(handle);
break;
case 2:
printf("2");
break;
case 5:
printf("Releasing Memory.....\n");
release(handle);
//释放内存
i=0;
break;
}
}
return 0;
}
int display(struct matrix* handle)
{
struct matrix *row,*c;
printf("Starting display the Matrix.....\n\n");
row=handle;