diff --git a/.gitignore b/.gitignore index 7af84b9..cf8b4b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .vscode/** *.exe +Test/** !*.md \ No newline at end of file diff --git a/Test/README.md b/Test/README.md new file mode 100644 index 0000000..85cc732 --- /dev/null +++ b/Test/README.md @@ -0,0 +1 @@ +此文件夹用于存放测试文件 \ No newline at end of file diff --git a/数据结构/队列/main.c b/数据结构/队列/main.c index c19bc60..3b60d4c 100644 --- a/数据结构/队列/main.c +++ b/数据结构/队列/main.c @@ -3,7 +3,8 @@ int main(){ - SqQuecu a_quecu; //初始化队列 + SqQuecu a_quecu; + InitQuecu(&a_quecu,10,sizeof(int));//初始化队列 //出队进队测试 int *tmep;//临时存储进对的返回值 for (size_t i = 0; i < 50; i++) @@ -31,5 +32,7 @@ int main(){ } DestroyQueue(&a_quecu); printf("队列已销毁\n"); + InitQuecu(&a_quecu,80,sizeof(char)); + return 0; } \ No newline at end of file diff --git a/数据结构/队列/queue.c b/数据结构/队列/queue.c index 873995b..18b2317 100644 --- a/数据结构/队列/queue.c +++ b/数据结构/队列/queue.c @@ -63,7 +63,7 @@ void *enQueue(SqQuecu *Q){ if(Q->rear==Q->Maxsize-1)Q->rear=-1; Q->rear++; Q->size++; - return Q->container+Q->rear*Q->NodeSize; + return Q->container + Q->rear*Q->NodeSize; } /*