Predefined Constants

Character and String-Related Definitions


Character Types

These macro definitions (Table
A.14) test whether a single character (type char) is a member of a particular class of characters, lower case letter or white space, for example. They resolve to a logical (bool) value which may be used in boolean expressions, including conditional statements such as while or for. They are defined in lib$ctype.h and, if they are to be used in code, must be included with the statement:

include <ctype.h> 


Table A.14: Character Types.

Note that these definitions work for ASCII, but not for EBCDIC (IBM). By using macros, this machine dependent knowledge of the character set is concentrated into a single file. For example

        for (ip = 1;  IS_WHITE(str[ip]);  ip = ip + 1) 
            ; 
Finds the first non-white-space character in the string str.

Character Types
Table A.14: - Character Types.

Generated with CERN WebMaker