#include <iostream>
#include <cctype>
using namespace std;
void convertToUppercase(char * );
int main()
{
char phrase[]="characters and $32.98";
cout<<"The phrase before conversion is: "<<phrase;
convertToUppercase(phrase);
cout<<"\nThe phrase after conversion is: "<<phrase<<endl;
return 0;
}
void convertToUppercase(char *sPtr )
{
while(*sPtr!='\0')
{
if(islower(*sPtr))
*sPtr=toupper(*sPtr);
*sPtr++;
}
}
//@author xkxy
小写字母转换为大写字母
最新推荐文章于 2022-02-26 23:31:48 发布