当前位置: 代码迷 >> 综合 >> string.h 中的字符大小写转换
  详细解决方案

string.h 中的字符大小写转换

热度:92   发布时间:2024-01-21 07:00:14.0

char*strupr(char *string)

功能:将字符串string中的小写字母转换为大写,并返回指向string的指针。

char*strlwr(char *string)

功能:将字符串string中的大写字母转换为小写,并返回指向string的指针。


#include<iostream>
#include<string.h>
#include <string>
using namespace std;
void main(void)
{char *p;std::string  m("Design and implementation of the remote location robot and control system ");p=strupr((char *)m.c_str());cout<<p<<"      "<<m<<endl;std::string n("DFGRADGHHEVGV");p=strlwr((char*)n.c_str());cout<<p<< "    "<<n<<endl;getchar();
}




  相关解决方案