CAlive will allow the prior or next thing referenced using the
-$ and
+$ syntax. These can be used as references to obtain the size, or a pointer to the referenced thing, depending on context.
struct SPairs
{
s8* text;
u32 length;
};
SPairs pairs[] =
{
{ "first", sizeof(-$) },
{ "second", sizeof(-$) },
{ "third", sizeof(-$) },
{ "fourt", sizeof(-$) },
};
printf("The string is %d bytes, and is: %s", sizeof(+$), "Hello mom!");
--
Rick C. Hodgin