isprint, iswprint, _ismbcprint

From RAD Studio
Jump to: navigation, search

Go Up to ctype.h Index

Header File

ctype.h, wctype.h, mbstring.h

Category

Classification Routines

Prototype

int isprint(int c);

int iswprint(wint_t c);

int _ismbcprint(unsigned int c);

Description

Tests for printing character.

isprint is a macro that classifies ASCII-coded integer values by table lookup. The macro is affected by the current locale's LC_CTYPE category. For the default C locale, c is a printing character including the blank space (' ').

You can make this macro available as a function by undefining (#undef) it.

Return Value

isprint returns nonzero if c is a printing character.

Example

#include <stdio.h>
#include <ctype.h>
int main(void)
{
  char c = 'C';
  if (isprint(c))
    printf("%c is a printable character\n",c);
  else
    printf("%c is not a printable character\n",c);
  return 0;
}

Portability

POSIX Win32 ANSI C ANSI C++

isprint

+

+

+

+

_ismbcprint

+

iswprint

+