C++ Reference: Standard C++ Library reference: C Library: cctype: isspace
C++官方参考链接:https://cplusplus.com/reference/cctype/isspace/
字符分类函数
它们检查作为形参传递的字符是否属于某个类别:
函数
isspace
int isspace ( int c );
检查字符是否是空白
检查c是否为空白字符。
对于“C”语言环境,空白字符是:
' ' | (0x20) | space (SPC)(空格) |
'\t' | (0x09) | horizontal tab (TAB)(水平制表符) |
'\n' | (0x0a) | newline (LF)(换行) |
'\v' | (0x0b) | vertical tab (VT)(垂直制表符) |
'\f' | (0x0c) | feed (FF)(换页) |
'\r' | (0x0d) | carriage return (CR)(回车) |
其他语言环境可能会将不同的字符选择视为空白,但绝不会将isalnum返回false的字符视为空白。
有关不同的ctype函数为标准ASCII字符集的每个字符返回什么的详细图表,请参阅头文件<cctype>的参考资料。
在C++中,此函数 (isspace)的特定于语言环境的模板版本存在于头文件<locale>中。
形参
c
要检查的字符,转换为int值或EOF。
返回值
如果c确实是一个空白字符,一个不同于0的值(即true)。否则为0(即为false)。
用例
/* isspace example */
#include <stdio.h>
#include <ctype.h>
int main ()
{
char c;
int i=0;
char str[]="Example sentence to test isspace\n";
while (str[i])
{
c=str[i];
if (isspace(c)) c='\n';
putchar (c);
i++;
}
return 0;
}
这段代码逐个字符地输出C字符串,用换行符替换任何空白字符。输出:
C++ Reference: Standard C++ Library reference: C Library: cctype: isspace相关推荐
- Conditional project or library reference in Visual Studio
Conditional project or library reference in Visual Studio In case you were wondering why you haven't ...
- link library 、target library、symbol library、synthetic library对照分析-基础小知识(九)
文章目录 1.1 概念介绍 1.2 疑问解析 参考文档 DC 应用过程中涉及link library .target library.symbol library.synthetic library, ...
- undefined reference to `__stack_chk_guard' .. undefined reference to `__stack_chk_fail'
1. 编译出错 undefined reference to `__stack_chk_guard' undefined reference to `__stack_chk_fail' 解决方法-1: ...
- git fatal: cannot lock ref ‘HEAD‘:unable to resolve reference‘refs/heads/main‘:reference broken
问题: push的时候,电脑强制关机再启动,vscode中所有文件都变成了绿色,暂存待提交状态 当我再次提交时,就出现错误:git fatal: cannot lock ref 'HEAD':unab ...
- undefined reference to 'floor'/undefined reference to
undefined reference to 'floor'/undefined reference to `& undefined reference to 'pow'/undefined ...
- 问题排查--@cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken解决方法
@cannot lock ref 'HEAD': unable to resolve reference 'refs/heads/master': reference broken解决 作者用的是ID ...
- C++ Reference: Standard C++ Library reference: C Library: cmath: cbrt
C++官网参考链接:https://cplusplus.com/reference/cmath/cbrt/ 函数 <cmath> <ctgmath> cbrt C99 dou ...
- C++ Reference: Standard C++ Library reference: C Library: cmath: erf
C++官网参考链接:https://cplusplus.com/reference/cmath/erf/ 函数 <cmath> <ctgmath> erf C99 doubl ...
- C++ Reference: Standard C++ Library reference: C Library: cstdio: printf
C++官网参考链接:https://cplusplus.com/reference/cstdio/printf/ 函数 <cstdio> printf int printf ( cons ...
最新文章
- Python 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。
- php类库下载下来怎么使用,PHP如何实现$this-[类库名称]-[类库方法]。
- 计算机网络笔记----应用层
- 知乎热点:数学专业的学霸们毕业后都在做什么
- 最近打算学习windows核心编程
- vue项目打包部署-----解决打包后访问资源失败问题
- 计算机职称评定认可增刊吗,核心期刊增刊评定职称可以用吗?
- C++ TBB 文档手册地址
- 阶段3 2.Spring_08.面向切面编程 AOP_10 总结和作业安排
- android widget 开发实例 : 桌面便签程序的实现具体解释和源代码 (上)
- c语言食堂饭卡管理课程设计,第十一章 C语言课程设计—饭卡管理程序.docx
- 用 “普通话” 讲算法之 VIBE算法
- STM32F103 实现 简易闹钟小程序
- Android端轻量级远程JDBC库remote-db
- 顶级业务架构设计的“道”与“术”,醍醐灌顶!
- vue中将html页面转为图片并且下载该图片
- stm32mp15x环境搭建基于linux环境(上)
- Java switch 详解
- 生僻字存不到mysql_数据库存储生僻字存在的问题
- Linux多定时器的实现之一
热门文章
- 打开串口类软件出现安装datasocket.msi,解决方案
- bootstrap中添加图标
- 2019/4/2UPC团队训练题解(A,B,E,G,I,K,L)加补题(C,D)
- 6-Gans-01_手写数据集vanilla_gans
- 华为手机进行位置共享
- 获取全球各大证券交易所的全部股票交易信息
- 全网最全数据分析图形合集,建议收藏
- 凯里学院计算机等级考试,9月份考计算机等级考试的同学注意了
- 网易云商·七鱼智能客服自适应 ProtoStuff 数据库缓存实践
- 按关键词搜索1688商品接口,关键词搜索1688商品接口,1688搜索商品列表接口,接口接入说明