#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
char sz[] = "aBcDefGHIJklmn";
cout << sz << endl;
::CharLowerA(sz);
cout << sz << endl;
::CharUpperA(sz);
cout << sz << endl;
bool upper(true);
for (unsigned i = 0; i < strlen(sz); ++i)
{
if (upper)
::CharUpperA(&sz[i]);
else ::CharLowerA(&sz[i]);
upper = !upper;
}
LPCSTR lpsz = sz;
cout << lpsz << endl;
return 0;
}
输出:
aBcDefGHIJklmn
abcdefghijklmn
ABCDEFGHIJKLMN
AbCdEfGhIjKlMn
请按任意键继续. . .