c语言链表移动北理工,北京理工大学c语言网络教室 链表
#include
#include
void main()
{
FILE *fp;
char ch;
if((fp=fopen("E:\學習\c語言\Microsoft Visual Studio\MyProjects\data1.txt","r"))==NULL) {
printf("File open Error.\n");
exit(0);
}
while ((ch=fgetc(fp))!=EOF)
putchar(ch);
fclose(fp);
}
順序鏈表
#include "stdio.h"
#include
struct node
{ int data;
struct node * next;
} ;
typedef struct node NODE;//將struct node定義成NODE
typedef struct node * PNODE;
outlist( PNODE head )
{ PNODE p;
p = head->next;
while ( p != NULL )
{ printf("%d\n", p->data);
p = p->next;
}
}
ins_list( PNODE h, int num )
{
PNODE p,q;
p=(PNODE)malloc(sizeof(NODE));
p->data=num;
while(q->next!=NULL)q=q->next;
總結
以上是生活随笔為你收集整理的c语言链表移动北理工,北京理工大学c语言网络教室 链表的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 暑假学习打卡【4】——北理工乐学第四周作
- 下一篇: 暑假学习打卡【3】——北理工乐学第三周作