结构体的应用
#include <stdio.h>struct p
{
int x;
int y;
};
struct pp
{
struct p q1;
struct p q2;
};
void printpp(struct pp rr);
int main(void)
{
struct pp qq[] = {{{1,2},{3,4}},{{5,6},{7,8}}};
int i;
for(i = 0;i < 2; i++){printpp(qq);}
}
void printpp(struct pp rr)
{
printf("<%d, %d>,<%d, %d>\n",rr.q1.x,rr.q1.y,rr.q2.x,rr.q2.y);
}
页:
[1]