我收到一个我无法弄清楚的错误。我正在尝试定义结构的实例。我在代码中多次执行此操作,每次都得到相同的错误。我不确定我做错了什么。
结构定义:
struct hashLink {
KeyType key; /*the key is what you use to look up a hashLink*/
ValueType value; /*the value stored with the hashLink, a pointer to int in the case of concordance*/
struct hashLink * next; /*notice how these are like linked list nodes*/
};
typedef struct hashLink hashLink;
调用代码(一个例子):
hashLink *temp = malloc(sizeof hashLink);
hashLink *temp2 = malloc(sizeof hashLink);
我得到的确切错误是:
C:\Users\Marshall\C\CS261\hashMap.c||In function '_freeMap':|
C:\Users\Marshall\C\CS261\hashMap.c|73|error: expected expression before 'hashLink'|
C:\Users\Marshall\C\CS261\hashMap.c|74|error: expected expression before 'hashLink'|