什么是用C空白符号? [英] What is the symbol for whitespace in C?

查看:202
本文介绍了什么是用C空白符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出如何检查字符是否相等C.由空格我知道标签是'\\ T'和换行的'\\ n',但我希望能够检查只是一个(从空格键)的内部的常规正常空间,如果声明。

I am trying to figure out how to check if a character is equal to whitespace in C. I know that tabs are '\t' and newlines are '\n', but I want to be able to check for just a regular normal space (from the spacebar) inside of an if statement.

有谁知道什么是字符呢?

Does anybody know what is the character for this?

推荐答案

有是空白没有特别的象征。空白字符习惯:

There is no particular symbol for whitespace. Whitespace characters are customarily:

' '      space 
'\t'     horizontal tab 
'\n'     newline
'\v'     vertical tab 
'\f'     feed 
'\r'     carriage return    

使用 isspace为 <从 文件ctype.h 标准库函数/ code,如果你要检查这些白色空间> 。

Use isspace standard library function from ctype.h if you want to check for any of these white-spaces.

有关只是一个空间,使用

For just a space, use ' '.

这篇关于什么是用C空白符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆