Author: mimusmimus Date: Apr 29, 2008 14:06
On Tue, 29 Apr 2008 13:41:51 +0100, Paul wrote:
> How do I find the length of strings within an array at compile time?
>
> The following is not safe:
>
> const char* MyStrings[] =
> {
> "one",
> "two",
> "three",
> "end marker"
> }
>
> #define StringLength(index) MyStrings[index+1] - MyStrings[index]
>
> Since the strings may not be placed consecutively, or in order, within
> memory.
|