// queue.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
/*
int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}*/
#include<stdio.h>
#include<malloc.h> //包含了malloc函数
/*
*循环队列,用数组实现
*/
//队列结构体定义
#define QueueLenth 12 //改变队列结构长度
typedef struct Queue
{
int * pBase; //用于动态分配内存,pBase保存数组的首地址
int front; //指向头结点
int rear; //指向最后一个元素的下一结点
} QUEUE;
//函数声明
/*
*初始化函数的实现
*/
void initQueue(QUEUE * pQueue)
{
//分配内存
pQueue->pBase = (int *)malloc(sizeof(int) * 12); //分配6个int型所占的空间
pQueu
//
#include "stdafx.h"
/*
int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}*/
#include<stdio.h>
#include<malloc.h> //包含了malloc函数
/*
*循环队列,用数组实现
*/
//队列结构体定义
#define QueueLenth 12 //改变队列结构长度
typedef struct Queue
{
int * pBase; //用于动态分配内存,pBase保存数组的首地址
int front; //指向头结点
int rear; //指向最后一个元素的下一结点
} QUEUE;
//函数声明
/*
*初始化函数的实现
*/
void initQueue(QUEUE * pQueue)
{
//分配内存
pQueue->pBase = (int *)malloc(sizeof(int) * 12); //分配6个int型所占的空间
pQueu