So here is my code:
The purpose of this code is to take all the plain text in all capital letters in
the vitranc.txt file and turn them all in to lowercase characters.
Now to my knowledge i can do this with "tolower" function but:
when i add tolower in my "while" counter it does not compile but gives an error
about some conversion from char to int.
Now in addition i have also tried turning the "lists" to int whit "atoi" method before
passing it on to "tolower" and it works but not as it should only few words get turned
to lowercase but most remain uppercase.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(){
FILE *open;
open = fopen("vitranc.txt","r");
char lines[300];
while(!feof(open)){
fgets(lines,300,open);
lines = tolower(atoi(lines));
printf("%s",lines);
}
printf("\n\n");
fclose(open);
}
Instead of a while counter i have tried a "for" expression in this way:
char lines[300];
int i;
for(i=0;lines[i],i++){
lines[i] = tolower(lines[i]);
printf("%s",lines);
}