toupper:
int toupper(int c)
若c为小写字母,则将其转换为大写字母;否则,不转换,直接返回c。
tolower:
int tolower(int c)
若c为大写字母,则将其转换为小写字母;否则,不转换,直接返回c。
在C语言中,小写字母转换为大写字母的方法是将小写字母的ASCII码值减去32(例:A=a-32);大写字母转换为小写字母的的方法是将大写字母的ASCII码值加上32(例:a=A+32)即可。toupper:
int toupper(int c)
若c为小写字母,则将其转换为大写字母;否则,不转换,直接返回c。
tolower:
int tolower(int c)
若c为大写字母,则将其转换为小写字母;否则,不转换,直接返回c。
在C语言中,小写字母转换为大写字母的方法是将小写字母的ASCII码值减去32(例:A=a-32);大写字母转换为小写字母的的方法是将大写字母的ASCII码值加上32(例:a=A+32)即可。