Search This Blog
Sunday, April 1, 2012
Symbolic Constants
Symbolic Constants
A symbolic constant is a constant that is represented by a symbol (name) in a program. A non numeric constant may consist of letters, digits, and other characters.
The literals enclosed in single quotes are referred to as character values. Others those enclosed in double quotes are called character strings. In C you can use a name to represent a constant. The value associated with a constant cannot be changed or reassigned.
‘a’, ‘b’, ‘,’, ‘;’ - character constants.
“Hello”, “Information”, “31/12/1999” - string constants.
Numeric constants in C are made up of digits and can include decimal points and contain letters and do not
have single or double quotes.
Constants can be defined by using by using the # define construct.
# define a 10
# define ch ‘a’
# define msg “End of Program”
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment