Unix
GNOME端末のエラーについての質問です。
自分はUnix系のGNOME端末を使ってプログラムのコンパイルなどやってます。
今C言語で以下のようなプログラムをコンパイルしたところ、12行目でc:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OpenHashTableAlloc’とエラーが出ました。このエラーの意味を教えていただけますでしょうか?
#include <stdio.h>
#include <stdlib.h>
struct OpenHashTable{
int bucket_num;
char *buckets;
};
OpenHashTable OpenHashTableAlloc(void) ←12行目
{
OpenHashTable *table;
table = (OpenHashTable *)malloc(sizeof(OpenHashTable));
if(table == NULL) {
return (NULL);
}
table->bucket_num = 0;
table->buckets = NULL;
return (table);
}
int main(void)
{
OpenHashTableAlloc();
return 0;
}