C语言 isspace函数使用问题记录 您所在的位置:网站首页 isspace在python中的意思 C语言 isspace函数使用问题记录

C语言 isspace函数使用问题记录

#C语言 isspace函数使用问题记录| 来源: 网络整理| 查看: 265

C语言 isspace()函数使用问题记录

一般使用该函数很自然的认为所得的函数值应该是0或1,但实际使用后会返回0或8。和其他人交流后发现在mac上使用会得到预料中的返回值0或1。在查找源码后没有看懂,在此记录。

测试代码 #include #include int main(){ char a_space = ' '; char not_a_space = '1'; printf("the result of a_space is %d\n", isspace(a_space)); printf("the result of not_a_space is %d\n", isspace(not_a_space)); retrun 0; } Windows运行结果

Windows运行结果

Mac运行结果

Mac运行结果

isspace()函数源码

尝试通过源码进行分析,由于看不懂失败了,就不把源码贴在这了



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有