Currently I have websites store in char *banned[100] and I want to convert them all into lowercase using:
char *banned[100];
int x = 0;
if(fgets(temp, 100, file) != NULL) {
char *tempstore;
tempstore = (char*) malloc(sizeof(temp));
strcpy(tempstore, temp);
banned[x] = tempstore;
x++;
}
char temps[100];
while(banned[c]){
temps[c]=putchar(tolower(*banned[c]));
c++;
}
But the results are not what I'm expecting. Can I get some tips/hints on what I'm doing wrong?
putchar()doing there? What do you think it does? Also note thatbannedis an array of 100char*(string) elements, whiletempsis an array of 100char(character) elements.tempsis a string by itself; it is not an array of strings.