C++ Locale 库 - isgraph
描述
它检查字符是否具有图形表示,并且具有图形表示的字符是除空格字符 (' ') 之外的所有可以打印的字符(由 isprint 确定)。
声明
以下是 std::isgraph 的声明。
C++98
int isgraph ( int c );
C++11
int isgraph ( int c );
参数
c − 要检查、转换为 int 或 EOF 的字符。
返回值
它返回一个不同于零的值。
异常
No-throw guarantee − 此函数从不抛出异常。
示例
在下面的 std::isgraph 示例中。
#include <stdio.h>
#include <ctype.h>
int main () {
FILE * pFile;
int c;
pFile=fopen ("myfile.txt","r");
if (pFile) {
do {
c = fgetc (pFile);
if (isgraph(c)) putchar (c);
} while (c != EOF);
fclose (pFile);
}
}

