I am a bit confused with the next statment in implementation:
void add(char *prefix[NPREF], char *suffix) {
State *sp;
sp = lookup(prefix, 1);
//addsuffix(sp, suffix);
printf("size of prefix %d",&prefix);
printf("size of prefix %s", prefix + 1);
printf("size of prefix %d \n", &prefix+1);
for (int i = 0; i < NPREF; i++)
printf("%s \n" , prefix[i]);
printf("memmove \n");
memmove(prefix, prefix + 1, (NPREF - 1) * sizeof(prefix[0]));
prefix[NPREF - 1] = suffix;
for (int i = 0; i < NPREF; i++)
printf("%s \n", prefix[i]);
}
mmemove(prefix, prefix + 1, (NPREF - 1) * sizeof(prefix[0]));
So prefix is a pointer of type char. In this terms prefix + 1 is the link to the next char in the array, isn't it?
How is it works in the right way? I've read about memmove and read about pointers but couldn't explore this add function behaviore for myself.