. 把字符串s转换为小写
char* lower(char s[])
{
char *p = s;
while( *p != '\0')
{
if(*p >= 'A' && *p <= 'a')
*p = *p +'a' -'A';
p++;
}
return s;
}
. 检查系统大小端
checkCPU()
{
union w{
int a;
char b;
}c;
c.a = 1;
return (c.b == 1);
}
char* lower(char s[])
{
char *p = s;
while( *p != '\0')
{
if(*p >= 'A' && *p <= 'a')
*p = *p +'a' -'A';
p++;
}
return s;
}
. 检查系统大小端
checkCPU()
{
union w{
int a;
char b;
}c;
c.a = 1;
return (c.b == 1);
}