-2

このデータ構造を使用する: (双方向にリンクされたリストの配列)

list<string> hashTable [HASH_TABLE_SIZE];

次を使用して、特定のリンクリストが空であるかどうかを確認したいと思います。

Hash HashTable;

if(Hash[hf(word)].empty() == true)
{do this}

これらは私が得るコンパイルエラーです:

$ make -f makefile.txt
g++ -g -D HASH_TABLE_SIZE=10 -c hash.cpp
hash.cpp: In member function `void Hash::processFile(std::string)':
hash.cpp:19: error: expected primary-expression before '[' token
makefile.txt:6: recipe for target `hash.o' failed
make: *** [hash.o] Error 1
4

1 に答える 1