Tuesday 2 September 2014

Rules for Constructing Character Constants


  • A character constant is a single alphabet, a single digit or a single special symbol enclosed within single inverted commas.
  • Both the inverted commas should point to the left. 

Example:
                  ’A’ is a valid character constant whereas ‘A’ is not.

The maximum length of a character constant can be 1 character.
Example:
                   'A'
                   'I'
                   '5'
                   '='

No comments:

Post a Comment