int main() {
unsigned long s = CHAR_BIT * sizeof(1l); // bit size; must be power of 2
unsigned long mask = ~0UL;
printf("s = %lu n", s);
pb(s);
printf("s = %lu n", mask);
pb(mask);
unsigned long i = rev(1l);
printf("s = %lu n", i);
pb(i);
char str[30] = " 2030300 This is test";
char *ptr;
long ret;
ret = strtoll(str, &ptr, 10);
printf("数字(无符号长整数)是 %ldn", ret);
printf("n字符串部分是 |%s|", ptr);
if (isspace(((char*)str)[0])){
if (ptr[0] != ' '){
printf("nptr[0] != '\0' |%s|", ptr);
}
printf("n isspace |%s|", ptr);
}
}
|| 结果:
数字(无符号长整数)是 2030300
字符串部分是 | This is test|
ptr[0] != ' ' | This is test|
isspace | This is test|
Process finished with exit code 0