当前位置: 技术问答>linux和unix
字符串小写变大写
来源: 互联网 发布时间:2015-05-28
本文导语: windows下有strupr函数,linux7.2下有什么相似的函数,在哪个头文件声明的? | #include int toupper(int c); int tolower(int c); DESCRIPTION toupper() converts the letter c to u...
windows下有strupr函数,linux7.2下有什么相似的函数,在哪个头文件声明的?
|
#include
int toupper(int c);
int tolower(int c);
DESCRIPTION
toupper() converts the letter c to upper case, if possible.
tolower() converts the letter c to lower case, if possible.
If c is not an unsigned char value, or EOF, the behaviour of these
functions is undefined.
RETURN VALUE
The value returned is that of the converted letter, or c if the conver-
sion was not possible.
int toupper(int c);
int tolower(int c);
DESCRIPTION
toupper() converts the letter c to upper case, if possible.
tolower() converts the letter c to lower case, if possible.
If c is not an unsigned char value, or EOF, the behaviour of these
functions is undefined.
RETURN VALUE
The value returned is that of the converted letter, or c if the conver-
sion was not possible.
|
为什么自己不写呢?
char *strupr(char *str)
{
char *tmp = str;
while (*str != '')
{
if (*str >='a' && *str
char *strupr(char *str)
{
char *tmp = str;
while (*str != '')
{
if (*str >='a' && *str