C++把大写改成小写用哪个函数?
++把大写改成小写用哪个函数?
tolower 例如 tolower('A'), tolower('B'), ... 这个函数在 ctype.h 中. 同样, 小写改成大写用函数 toupper 请看下面例子: 如果是大写的就变成小写, 小写的就不变. #include #include void main() { char ch; printf("please enter some text (type a peried to quit.\n"); do { ch=getch(); printf("%c", ch); if(isupper(ch)) ch=tolower(ch); printf("%c", ch); } while (ch!='.'); }