I've decided to implement the load function using trie, which I've defined as
typdef struct trie
{
struct trie letters[27];
bool isWord;
}trie;
then later, when I try to access the last element, i.e, letters[27] as per
if (c == 96)
{
trav->letters[27] = malloc(sizeof(trie));
trav = trav->letters[27];
}
The compiler throws an error: array index 27 is past the end of the array (which contains 27 elements) Now, changing the definition of struct to 28 solves the problem, obviously, but when we define an array as - int array[x], doesn't it contain elements from 0 to x? That's how it works elsewhere I think, or am I doing something wrong? Thanks