Trying to convert uppercase char to lowercase in C without using a function

后端 未结 4 673
耶瑟儿~
耶瑟儿~ 2021-01-27 02:58

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

4条回答
  •  长发绾君心
    2021-01-27 03:23

    Ascii 136 is not a printable character. You should do something like lowercase = tolower - 'A' + 'a';, but only if tolower is uppercase for sure (it's not in your example).

提交回复
热议问题