Using functions isspace, iscntrl, ispunct, isprint, isgraph : char function « Data Type « C Tutorial

C Tutorial
1. Language
2. Data Type
3. String
4. printf scanf
5. Operator
6. Statement
7. Array
8. Function
9. Structure
10. Pointer
11. Memory
12. Preprocessor
13. File
14. Data Structure
15. Search Sort
16. Wide Character String
17. assert.h
18. ctype.h
19. math.h
20. setjmp.h
21. signal.h
22. stdio.h
23. stdlib.h
24. string.h
25. time.h
26. wctype.h
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C Tutorial » Data Type » char function 
2. 15. 3. Using functions isspace, iscntrl, ispunct, isprint, isgraph
#include <stdio.h>
#include <ctype.h>

int main()
{
   printf"%s\n%s%s%s\n%s%s%s\n%s%s\n\n"
       "According to isspace:"
       "Newline", isspace'\n' " is a " " is not a ",
       "whitespace character""Horizontal tab",
       isspace'\t' " is a " " is not a "
       "whitespace character",
       isspace'%' "% is a " "% is not a ",
       "whitespace character" );

   printf"%s\n%s%s%s\n%s%s\n\n""According to iscntrl:"
       "Newline", iscntrl'\n' " is a " " is not a ",
       "control character", iscntrl'$' "$ is a " 
       "$ is not a ""control character" );

   printf"%s\n%s%s\n%s%s\n%s%s\n\n"
       "According to ispunct:",
       ispunct';' "; is a " "; is not a "
       "punctuation character",
       ispunct'Y' "Y is a " "Y is not a ",
       "punctuation character",
       ispunct'#' "# is a " "# is not a ",
       "punctuation character" );

   printf"%s\n%s%s\n%s%s%s\n\n""According to isprint:",
       isprint'$' "$ is a " "$ is not a "
       "printing character"
       "Alert", isprint'\a' " is a " " is not a ",
       "printing character" );

   printf"%s\n%s%s\n%s%s%s\n",  "According to isgraph:",
       isgraph'Q' "Q is a " "Q is not a ",
       "printing character other than a space",
       "Space", isgraph' ' " is a " " is not a ",
       "printing character other than a space" );

   return 0

}
According to isspace:
Newline is a whitespace character
Horizontal tab is a whitespace character
% is not a whitespace character

According to iscntrl:
Newline is a control character
$ is not a control character

According to ispunct:
; is a punctuation character
Y is not a punctuation character
# is a punctuation character

According to isprint:
$ is a printing character
Alert is not a printing character

According to isgraph:
Q is a printing character other than a space
Space is not a printing character other than a space
2. 15. char function
2. 15. 1. Using functions islower, isupper, tolower, toupper
2. 15. 2. Using functions isdigit, isalpha, isalnum, and isxdigit
2. 15. 3. Using functions isspace, iscntrl, ispunct, isprint, isgraph
w___w_w_.___j__a__v_a2___s.co___m___ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.