Given the following typedefs:
// Structures for kana to romaji conversion lookup
typedef struct {
const u16 kana; // Kana codepoint
const char* romaji;
} KanaSuffix;
typedef struct {
// Kana codepoint is implied by position in array
const char* romaji;
const KanaSuffix* suffixes;
} KanaPrefix;
Is it possible to initialize an array of KanaPrefix
statically in a single step, where some elements of the array have suffixes
pointing to a static array of KanaSuffix
?
Now I'm doing this:
const KanaSuffix KANA_SUFFIXES_KI[] = {
{ 0x3030, "kya" },
{ 0x3032, "kyo" }
};
const KanaPrefix KANA_TO_ROMAJI[] = {
{ NULL, NULL },
{ "a", NULL },
{ "ki", KANA_SUFFIXES_KI }
};
But I want to do something more like this:
const KanaPrefix KANA_TO_ROMAJI[] = {
{ NULL, NULL },
{ "a", NULL },
{ "ki", {
{ 0x3030, "kya" },
{ 0x3032, "kyo" }
} }
};