next up previous contents index
Next: Specifying Data Type Up: Constants Previous: Logical Constants

Character Constants

  A character constant consists of a string of characters enclosed in a pair of apostrophes which act as quotation marks. Within the quoted string any characters available in the character set of the machine are permitted; the blank (or space) character is significant within character constants and counts as a single character just like any other. Examples of valid character constants are:
 
      'X' 
      ' 40 + 15%' 
      'This is a constant including spaces'

The apostrophe character can be included in a character constant by representing it as two successive apostrophes (with no intervening blanks). This pair of apostrophes only counts as a single character for the purposes of computing the length of the string. For example: 'DON''T' is a constant of length 5.



Helen Rowlands
8/27/1998