目录

isgraph

描述 (Description)

它检查字符是否具有图形表示,带有图形表示的字符是除了空格字符('')之外可以打印的字符(由isprint确定)。

声明 (Declaration)

以下是std :: isgraph的声明。

C++98

int isgraph ( int c );

C++11

int isgraph ( int c );

参数 (Parameters)

c - 要检查的字符,转换为int或EOF。

返回值 (Return Value)

它返回一个不等于零的值。

异常 (Exceptions)

No-throw guarantee - 此函数永远不会抛出异常。

例子 (Example)

在下面的示例中为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);
   }
}
↑回到顶部↑
WIKI教程 @2018