I'm trying to use the following code to convert every letters from a paragraph (strings) into lowercase letters before storing it back to the string. But the compiler wouldn't compile =(
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void spellCheck(char article[], char dictionary[]) {
int i = 0;
char* tempArticle;
tempArticle = malloc((strlen(article)+1) * sizeof(char));
strcpy(tempArticle, article);
*tempArticle = toLower(*tempArticle);
printf("%s", tempArticle);
}
char toLower(char letter){
if (letter >= 'A' && letter <='Z'){
letter = letter + 32;
}
return letter;
}