新微赢技术网
标题:
双链表问题
[打印本页]
作者:
简单快乐
时间:
2009-11-6 01:45
标题:
双链表问题
// 创建+打印双链表
// 问题在下面
#include"stdio.h"
#include"malloc.h"
#include"stdlib.h"
#define SIZE sizeof(snode)
typedef struct student
{
int num;
struct student *next;
struct student *prior;
}snode;
snode *create1();
//创建链表
void print(snode *head); //打印链表
void main(void)
{
snode *head1;
printf("\n链表为:\n");
head1=create1();
printf("\n链表为:\n");
print(head1);
}
snode *create1()
{
snode *head,*r,*s;
FILE *fp;
int num1;
head=(snode *)malloc(sizeof(SIZE));
head->next=head->prior=NULL;
r=head;
fp=fopen("D:\\qq.txt","r");
while(!feof(fp))
欢迎光临 新微赢技术网 (http://bbs.weiying.cn/)
Powered by Discuz! X3.2