I am trying to convert a char element from an char *argv[] array to lowercase from uppercase without using a function. I want to add 32 to the ascii integer.
When I try to pass the variable as an argument, it will show the integer sum, but not the new lowercase character. Instead it shows the following output:
letter h, 104 tolower: 136, � Code:
int i = 0; for(i = 0; argv[1][i] != '\0'; i++) { char letter = argv[1][i]; printf("letter %c, %i\n", letter, letter); char tolower = argv[1][i]; int lowercase = tolower + 32; printf("tolower: %i, %c\n", lowercase, lowercase); } Why is it printing a "?" char?
tolowerit's the name of a standard function.his already lowercase.letter >= 'A' && letter <= 'Z'