Section courante

A propos

Section administrative du site

ISGRAPH

Est-ce un graphique ?
Langage C ctype.h

Syntaxe

int isgraph(int caractere);

Paramètres

Nom Description
caractere Ce paramètre permet d'indiquer le caractère à vérifier

Description

Cette fonction indique si le caractère est un caractère graphique.

Remarques

Exemple

Voici un exemple permettant d'afficher les caractères graphique (1) ou non (0) entre l'intervalle 32 et 127 :

Essayer maintenant !
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4.  
  5. int main() {
  6.  int I;
  7.  for(I = 32; I <= 127; I++) {
  8.   printf("%c = %i, ",I,isgraph(I)?1:0);
  9.  }
  10.  printf("\n");
  11.  return 0;
  12. }

on obtiendra le résultat suivant :

= 0, ! = 1, " = 1, # = 1, $ = 1, % = 1, & = 1, ' = 1, ( = 1, ) = 1, * = 1, + =
1, , = 1, - = 1, . = 1, / = 1, 0 = 1, 1 = 1, 2 = 1, 3 = 1, 4 = 1, 5 = 1, 6 = 1,
7 = 1, 8 = 1, 9 = 1, : = 1, ; = 1, < = 1, = = 1, > = 1, ? = 1, @ = 1, A = 1, B
= 1, C = 1, D = 1, E = 1, F = 1, G = 1, H = 1, I = 1, J = 1, K = 1, L = 1, M = 1
, N = 1, O = 1, P = 1, Q = 1, R = 1, S = 1, T = 1, U = 1, V = 1, W = 1, X = 1, Y
= 1, Z = 1, [ = 1, \ = 1, ] = 1, ^ = 1, _ = 1, ` = 1, a = 1, b = 1, c = 1, d =
1, e = 1, f = 1, g = 1, h = 1, i = 1, j = 1, k = 1, l = 1, m = 1, n = 1, o = 1,
p = 1, q = 1, r = 1, s = 1, t = 1, u = 1, v = 1, w = 1, x = 1, y = 1, z = 1, { =
1, | = 1, } = 1, ~ = 1, ¦ = 0,

Voir également

Langage de programmation - C++ - Référence de procédures et fonctions - isgraph

Références

Langage C, Edition Micro-Application, Gehard Willms, 2001, ISBN: 2-7429-2008-0, page 732.
Borland C++ for Windows 4.0, Library Reference, Edition Borland, 1993, Part # BCP1240WW21772, page 152.

Dernière mise à jour : Mardi, le 28 juillet 2015