Hi.
I am trying to create a look up table in C. I have attempted it, but there are compilation errors occurring.
Can anyone tell me what i'm doing wrong/offer any advice?
I have in my header file the following:
struct
{
(void)(*function)();
const char* functionName;
}
lookUpTable[] = { {&TSL1_ReadMemory32, "ReadMemory32"}, {NULL, NULL} }; // Two nulls to indicate end of array...
Errors are as follows:
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(288) : error C2062: type 'void' unexpected
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(288) : error C2238: unexpected token(s) preceding ';'
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(290) : error C2059: syntax error : '{'
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(290) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
TSL1.cpp
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(288) : error C2062: type 'void' unexpected
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(288) : error C2238: unexpected token(s) preceding ';'
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(290) : error C2059: syntax error : '{'
c:\projects\umaster3xxxc++\inteldriver\tsl1\tsl1_commands.h(290) : error C2334: unexpected token(s) preceding '{'; skipping apparent function body
Error executing cl.exe.