#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct node
{
int data;
struct node *next;
}node,*pnode;
//该队列包含了一个队头和一个队尾
typedef struct queue
{
pnode front;
pnode rear;
}queue,*pqueue;
//初始化队列
void makenull(pqueue q)
{
q->front=(pnode)malloc(sizeof(...


- [游客] 表示每次运行到cx=2的时候就不能再往下一步进行了! 谁能告诉我是哪里的问题? 06/11 23:38
- [游客] 这是C下的么?main中的 int c[]={6,7,8,9} ; int *p = c; 08/06 15:33
- [游客] 实现队列?呵呵,以前学C的时候也弄过队,循环队列等东西,锻炼了很多思维逻辑上的东西。 博主可以自己 08/06 15:30
- [maxm] 这实验没难度,关键是细心 几个易出错的地儿我都在注释中做了标记 希望大家别跟我一样犯糊涂 (*^ 06/04 20:58
- [maxm] 感谢fangyugirl分享心得 05/08 18:47
- [fangyugirl] 看到你说你在这章徘徊了两周,我跟你差不多的。我是做BIOS的,上班时没有事情了就看书,做课程设计一时 04/23 13:44
- [maxm] 哎,没有自己电脑。 03/19 20:57
- [游客] 然后继续编程 呵呵 03/18 20:56
- [游客] 我被卡在这一章了,就因为这个实验。 03/18 15:31
- [maxm] 最后加了点注释,程序改动如下: ;------------------------------ 03/13 15:52
[2009-08-04 00:27] queue
阅读全文 |
评论次数(1) |
浏览次数(1033) |
所属类型(c)
[2009-08-04 00:26] *p p* swap
#include <stdio.h>
#include <stdlib.h>
void swap(int *a,int *b);
main()
{
int a = 3;
int b = 4;
printf("%d %d\n", a, b);
swap(&a, &b);
printf("%d %d\n", a, b);
int c[]={6,7,8,9} ;
int *p = c;
printf("%d ", *p);
...
#include <stdlib.h>
void swap(int *a,int *b);
main()
{
int a = 3;
int b = 4;
printf("%d %d\n", a, b);
swap(&a, &b);
printf("%d %d\n", a, b);
int c[]={6,7,8,9} ;
int *p = c;
printf("%d ", *p);
...
阅读全文 |
评论次数(1) |
浏览次数(1003) |
所属类型(c)
页码数(1):
1