C++ 本地化庫 - isgraph



描述

它檢查字元是否具有圖形表示,並且具有圖形表示的字元是所有可以列印的字元(由isprint確定),但空格字元(' ')除外。

宣告

以下是 std::isgraph 的宣告。

C++98

int isgraph ( int c );

C++11

int isgraph ( int c );

引數

c − 要檢查的字元,轉換為 int 型別,或 EOF。

返回值

它返回一個非零值。

異常

無異常保證 − 此函式從不丟擲異常。

示例

以下是 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);
   }
}
locale.htm
廣告