CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Declaration of const table

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Christophe



Joined: 10 May 2005
Posts: 323
Location: Belgium

View user's profile Send private message

Declaration of const table
PostPosted: Thu Feb 01, 2007 6:38 am     Reply with quote

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







PostPosted: Thu Feb 01, 2007 8:22 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Feb 01, 2007 8:24 am     Reply with quote

Why the row length (20 or 16) has to be filled in?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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