I'm writing a function that inserts a small list into a tree view control, and when the program gets certain input, it can have variable numbers of entries. ex:
char *numbers[] = {"one","two","three"};
my function has to calculate how many 'words' are in the array. I can't seem to figure out how to do this.
int num = sizeof(numbers)/sizeof(numbers[0]);
int num = sizeof(numbers)/sizeof(char*);
...
so far, num turns out to be 2, even if i add a "four" into the array. Anyone have ideas.
PS: I'm sorry if there's a post about this, but i searched many times and the search phrases i used didn't bring up anything useful.