回复 7楼 so_love
#include"stdio.h"
void jz(*pointer);
int main()
{
int i,j,*p,a[3][3];
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
scanf("%d",&a[i][j]);
}
p=&a[0][0];
jz(p);
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%d",a[i][j]);
return 0;
}
void jz (*pointer)
{
int i,j,k;
for(i=0;i<3;i++)
{
for(j=i;j<3;j++)
k=(*pointer+3*i+j);
(*pointer+3*i+j)=(*pointer+3*j+i);
(*pointer+3*j+i)=k;
return 0;
}}
这是最后修改的,,,
还是不行
总是指向开头和结尾
C:\Users\Administrator\Desktop\yen\za\矩阵.c(2) : error C2143: syntax error : missing ')' before '*'
C:\Users\Administrator\Desktop\yen\za\矩阵.c(2) : error C2143: syntax error : missing '{' before '*'
C:\Users\Administrator\Desktop\yen\za\矩阵.c(2) : error C2059: syntax error : ')'
C:\Users\Administrator\Desktop\yen\za\矩阵.c(12) : warning C4013: 'jz' undefined; assuming extern returning int
C:\Users\Administrator\Desktop\yen\za\矩阵.c(20) : error C2143: syntax error : missing ';' before 'type'
C:\Users\Administrator\Desktop\yen\za\矩阵.c(26) : error C2065: 'k' : undeclared identifier
C:\Users\Administrator\Desktop\yen\za\矩阵.c(27) : error C2106: '=' : left operand must be l-value
C:\Users\Administrator\Desktop\yen\za\矩阵.c(28) : error C2106: '=' : left operand must be l-value