回楼上的: 是这意思.
确实行参用指针比较好做.
指针看这个
http://bbs.bc-cn.net/viewthread.php?tid=98352
#include "stdio.h"
#define PARAM unsigned long
typedef struct {
int x;
int y;
int z;
}tagpoint[100][100];
void InitPoint(tagpoint* tp) {
int i,j;
for(i=0;i<100;i++) {
for(j=0;j<100;j++) {
(*tp)[i][j].x=0;
(*tp)[i][j].y=1;
(*tp)[i][j].z=2;
}
}
}
void InitPoint2(PARAM p) {
int i,j;
tagpoint* tp=(tagpoint*)p;
for(i=0;i<100;i++) {
for(j=0;j<100;j++) {
(*tp)[i][j].x=0;
(*tp)[i][j].y=1;
(*tp)[i][j].z=2;
}
}
}
void print(tagpoint p) {
int i,j;
for(i=0;i<100;i++) {
for(j=0;j<100;j++) {
printf("%d%d%d ",p[i][j].x,p[i][j].y,p[i][j].z);
}
printf("\n");
}
}
void print2(PARAM p) {
tagpoint* tp=(tagpoint*)p;
int i,j;
for(i=0;i<100;i++) {
for(j=0;j<100;j++) {
printf("%d%d%d ",(*tp)[i][j].x,(*tp)[i][j].y,(*tp)[i][j].z);
}
printf("\n");
}
}
main()
{
tagpoint story;
InitPoint(&story);
print(story);
InitPoint2((PARAM)&story);
print2((PARAM)&story);
}
上述例子中bagpoint[100],关键维数100是不知道的.