Your Ad Here

Friday, August 1, 2008

Constants

Constants refer to fixed values that the program may not alter. Constants can be of any of the basic
data types. The way each constant is represented depends upon its type. Constants are also called
literals.
Character constants are enclosed between single quotes. For example, 'a' and '%' are both character
constants. C defines both multibyte characters, which consist of one or more bytes, and wide
characters (which are usually 16 bits long). Multibyte and wide characters are used primarily to
represent languages that have large character sets. To specify a multibyte character, enclose the
characters within single quotes, for example, 'xy'. To specify a wide character constant, precede the
character with an L. For example:
wchar_t wc;
wc = L'A';
Here,

No comments: