>char* word; /* Temporary holding for each word */
>fscanf(fin, "%s", word);
Pointers aren't magic containers for infinite data. You need to allocate space to word before you can write to it. In this case, there's little point in using a pointer unless you want to get fancy with single character reads.
>arts[index] = (char*)malloc(strlen(word) * sizeof(char));
You cast the result of malloc in one call but not another. Consistency is more important than perfect style, but I'd still recommend removing the cast. Also, instead of
sizeof(char) , you can get the same effect without specifying the type directly using
sizeof *arts[index] . Also note that sizeof(char) is guaranteed to be 1.
Finally, when allocating memory for a string, you need to add an extra slot for the null character. If you don't do that, you'll end up with problems later when overflowing the buffer.
Try this:
void populateArts(char **arts, FILE *fin, int *numArts)
{
int index;
char word[BUFSIZ]; /* Temporary holding for each word */
arts = malloc(*numArts * sizeof *arts);
fscanf(fin, "%s", word); /* Skip over category */
/* Fill articles array */
for(index = 0; index < *numArts; index++)
{
fscanf(fin, "%s", word);
printf("word is %s\n", word);
arts[index] = malloc(strlen(word) + 1);
strcpy(arts[index], word);
}
}