C - String Manipulation Functions, iscntrl
Tutorials Point


  Learning C
  C Function References
  C Useful Resources
  Selected Reading

Copyright © 2014 by tutorialspoint



  Home     References     About TP     Advertising  

C - iscntrl function

previous

Synopsis:

#include <stdio.h>

int iscntrl(int c); 

Description:

The function returns nonzero if c is any of:

BEL BS CR FF HT NL VT

Return Value

The function returns nonzero if c is control chracter line new line, back space etc. otherwise this will return zero which will be equivalent to false.

Example

#include <stdio.h>

int main() {

  if( iscntrl( 'a' ) )
  {
     printf( "Character a is not control character\n" );
  }
  if( iscntrl( '\n' ) )
  {
     printf( "Character \n is control chracter\n" );
  }
  return 0;
}

It will proiduce following result:

Character \n is control chracter


previous Printer Friendly

Advertisements


  

Advertisements



Advertisements