【发布时间】:2021-05-13 04:58:19
【问题描述】:
这是我的优先队列练习代码。
#include <stdio.h>
#include <stdlib.h>
#define MAX_ELEMENT 200
typedef struct{
int key;
}element;
typedef struct{
element heap[MAX_ELEMENT];
int heap_size;
}HeapType;
// create function
HeapType* create()
{
return (HeapType*)malloc(sizeof(HeapType));
}
// initialization function
void init(HeapType*h)
{
h->heap_size = 0;
}
编译这段代码时,我收到一条消息“未定义对 `WinMain' 的引用”
程序通知我这一行有问题 > 'return (HeapType*)malloc(sizeof(HeapType)); '
我可以为这个问题做些什么?
【问题讨论】:
-
您没有
main函数。这是预期的吗? -
这能回答你的问题吗? undefined reference to `WinMain@16'
标签: c priority-queue