You can use strlen for the string length. Also, you are using strcpy a lot of times. Ultimately, you are copying only the null terminator. The function strcpy does this work for you. strcpy copies each character up to an expected null terminator into your new buffer. In other words, you don't use it to copy a character at a time but a string at a time. Although, I'm not sure what your function is intended to do at this point.
void spellCheck(char article[], char dictionary[]) {
int i = 0;
char* tempArticle;
/*while ( article[i] != '\0'){
i++;
}*/
tempArticle = malloc((strlen(article)+1) * sizeof(char));
/*i=0;
while (article[i] != '\0'){
strcpy(tempArticle, article[i]);
}*/
strcpy(tempArticle, article);
printf("%s", tempArticle);
}
Again, in other words, your second loop was essentially trying to copy a smaller and smaller string into the tempArticle
buffer until you ended up copying an empty string into it.
(minor point, another answerer pointed out that your second loop was an infinite loop because i
was not being incremented. However, you still the had the other problems mentioned)
Edit
So to answer the comment of converting it to lowercase. In general to convert an entire string to lowercase, you would just do something like this:
char s[] = "THE String.";
char *c;
for(c = s; *c != '\0'; c++)
*c = (char)tolower(*c);