Board index » cppbuilder » size of a const at compile time
Wilfried Mestdagh
![]() CBuilder Developer |
size of a const at compile time2006-03-28 02:18:16 AM cppbuilder61 Hello, At the moment (well for many years) I have following code: #define MAX_LEN_TITLE 20 const u_8* blank_title = (u_8*)" "; Where blank_title is just a string to clear a title on a form (embedded system). The annoying thing is of course when I have to do a maintenance and for example a customer wants a title length of 22. Then I have to change also the const declaration. Not a big deal of course, but can this also automatically happen at compile time ? For example: const u_8 blank_title[MAX_LEN_TITLE + 1] ... euh but how to fill it with blanks at compile time ? of course another solution would be to make it a variable in the pool, but I like to have it in EPROM as I have not much spare memory. -- rgds, Wilfried www.mestdagh.biz |