代码为什么出现了这个
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#define MAX 10
typedef int TY_data;
typedef struct quece
{
TY_data* a;
int front;
int rear;
}SqQueue;
void InitSqQueue(SqQueue* s);
void InitSqQueue(SqQueue* s)
{
s->a = (TY_data*)malloc(sizeof(TY_data) * MAX);
if (s->a == NULL)
{
exit(1);
}
s->front = 0;
s->rear = 0;
printf("创建成功\n");
return 0;
}
int Queuelength(SqQueue s);
int Queuelength(SqQueue s)
{
return (s.rear - s.front + MAX) % MAX;
}
void PutSqQueue(SqQueue*, TY_data);
void PutSqQueue(SqQueue* s, TY_data b)
{
if ((s->rear + 1) % MAX == s->front)
{
printf("队列已满\n");
return 0;
}
s->a[s->rear] = b;
s->rear = (s->rear + 1) % MAX;
printf("入队成功\n");
return 0;
}
TY_data PopSqQuece(SqQueue* s);
TY_data PopSqQuece(SqQueue* s)
{
if (s->front == s->rear)
{
printf("队列为空\n");
return 0;
}
TY_data a;
a = s->a[s->front];
s->front = (s->front + 1) % MAX;
printf("出队成功\n");
return a;
}
TY_data GetHead(SqQueue* s);
TY_data GetHead(SqQueue* s)
{
if (s->front == s->rear)
{
printf("队列为空\n");
return 0;
}
TY_data a = 0;
a = s->a[s->front];
return 0;
}
void DestroySqQuece(SqQueue* s)
{
free(s->a);
s->a = NULL;
printf("销毁成功\n");
}
int main()
{
SqQueue* j;
InitSqQueue(&j);
int ch[5] = { 1,2,3,4,5 };
for (int i = 0; i < 5; i++)
{
PutSqQueue(&j, ch[i]);
}
for (int i = 0; i < 5; i++)
{
int a;
a = PopSqQuece(&j);
printf("%d\n",a);
}
DestroySqQuece(&j);
return 0;
}