69,369
社区成员
发帖
与我相关
我的任务
分享
#include"stdio.h"
#include"stdlib.h"
#define NULL 0
#define N 1
typedef struct _node{
int page;
int flag;
int mem;
int state;
int ci;
char m;
struct _node* next;
}node;
typedef struct _copy{
int pae;
int block;
char n;
struct _copy* next;
}copy;
void show(node* h)
{node *p;
p=h->next;
puts("页号:\n");
printf("%d",p);
while(p)
{printf("%d\n",p->page);
p=p->next;
}
}
void main()
{
int i,n;
node* head;
head=(node*)malloc(sizeof(node));
head->next = NULL;
node *p;
p=(node*)malloc(sizeof(node));
p->page=2;
p->flag=1;
p->mem=1;
p->state=0;
p->ci=0;
p->m=97;
p->next=head->next;
head->next = p;
for(i=0;i<9;i++)
{
end[i].n=97+i;end[i].block=i;//注意当 i = 8 时数组下标越界
end[i].pae=i;
}
show(head);
}
程序是一哥们写的,问题的出现太突然以至于本菜鸟小弟来不及接受。在这里恳请各位大侠慷慨拔刀相助!分会有的!
copy end[8];