C supports another type of constant: the string. A string is a set of characters enclosed in double
quotes. For example, ''this is a test" is a string. You have seen examples of strings in some of the
printf( ) statements in the sample programs. Although C allows you to define string constants, it
does not formally have a string data type.
You must not confuse strings with characters. A single character constant is enclosed in single
quotes, as in 'a'. However, "a" is a string containing only one letter.
Sunday, August 10, 2008
String Constants
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment