|
|
View previous topic :: View next topic |
Author |
Message |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
Declaration of const table |
Posted: Thu Feb 01, 2007 6:38 am |
|
|
Hi,
I want to create a list of strings (commands). However the compiler gives several errors on this. What is the exact declaration?
Code: | const char CommandArray [] [CMD_STR_LEN] =
{
#if (LEESREGEL)
{"BRAI"},
#endif
{"SUSP"},
{"BATT"},
{"ADAP"},
{"SLEE"},
{"WAKE"},
{"ADAS"},
{"LAAD"},
#if (LEESREGEL)
{"BRCL"},
{"BRWA"},
{"BRSL"},
#endif
{"5VOF"},
{"5VON"},
{"BTOK"},
{"OFTI"},
{"KLIK"},
{"BLOW"},
{"ALAR"},
{"BTYK"},
{"RSET"}
// {"TEST"},
}; |
|
|
|
Ttelmah Guest
|
|
Posted: Thu Feb 01, 2007 8:22 am |
|
|
Code: |
#ifdef LEESREGEL
const char CommandArray[20][5] = {
"BRAI",
"SUSP",
"BATT",
"ADAP",
"SLEE",
"WAKE",
"ADAS",
"LAAD",
"BRCL",
"BRWA",
"BRSL",
"5VOF",
"5VON",
"BTOK",
"OFTI",
"KLIK",
"BLOW",
"ALAR",
"BTYK",
"RSET"
};
#else
const char CommandArray[16][5] = {
"SUSP",
"BATT",
"ADAP",
"SLEE",
"WAKE",
"ADAS",
"LAAD",
"5VOF",
"5VON",
"BTOK",
"OFTI",
"KLIK",
"BLOW",
"ALAR",
"BTYK",
"RSET"
};
#endif
|
Best Wishes |
|
|
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
|
Posted: Thu Feb 01, 2007 8:24 am |
|
|
Why the row length (20 or 16) has to be filled in? |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|