isgraph, iswgraph, _isgraph_l, _iswgraph_l

确定整数是否表示图形字符。

语法

int isgraph(
   int c
);
int iswgraph(
   wint_t c
);
int _isgraph_l(
   int c,
   _locale_t locale
);
int _iswgraph_l(
   wint_t c,
   _locale_t locale
);

参数

c
要测试的整数。

返回值

如果 c 是可打印字符而非空格的特定表示形式,则每个例程将返回非零值。 如果 c 是可打印字符而非空格,则 isgraph 返回非零值。 如果 c 是可打印宽字符而非宽字符空格,则 iswgraph 返回非零值。 如果 c 不满足测试条件,则这些例程都返回 0。

这些后缀为 _l 的函数版本将传入的区域设置而不是当前区域设置用于其区域设置相关的行为。 有关详细信息,请参阅 Locale

如果 c 不是 EOF 或在范围 0 到 0xFF 内(包含 0 和 0xFF),则 isgraph_isgraph_l 的行为没有定义。 当使用调试 CRT 库并且 c 不是这些值中的一个时,函数将引发断言。

一般文本例程映射

TCHAR.H 例程 _UNICODE_MBCS 未定义 _MBCS 已定义 _UNICODE 已定义
_istgraph isgraph _ismbcgraph iswgraph
_istgraph_l _isgraph_l _ismbcgraph_l _iswgraph_l

备注

默认情况下,此函数的全局状态范围限定为应用程序。 若要更改此行为,请参阅 CRT 中的全局状态

要求

例程 必需的标头
isgraph <ctype.h>
iswgraph <ctype.h> 或 <wchar.h>
_isgraph_l <ctype.h>
_iswgraph_l <ctype.h> 或 <wchar.h>

有关兼容性的详细信息,请参阅 兼容性

另请参阅

字符分类
区域设置
is, isw 例程