Character Set and Keywords: Programming in C
Character Set and Keywords: Programming in C
Most versions of the language also allow certain other characters, such as @ and $, to be included within strings and comments. C uses certain combinations of these characters, such as \b,\n and \t, to represent special conditions such as backspace, new line, and horizontal tab, respectively These character combinations are known as escape sequences. Identifiers Identifiers are names that are given to various program elements, such as variable, functions and arrays. Identifiers consist of letters and digits, in any order, except that
Programming in C the first character must be a letter.; Both upper- and lowercase letters are permitted, though common usage favors the use of lowercase letters for most types of identifiers. Upper- and lowercase letters are not interchangeable. The underscore (_) character can also be included, and is considered to be a letter. An underscore is often used in the middle of an identifier. An identifier may also begin with an underscore, though this is rarely done in practice. The following names are valid identifiers: x y12 sum_1 tax_rate area _temperature
Key words There are certain reserved words, called keywords, which have standard, predefined meanings in C. These keywords can be used only for their intended purpose; they cannot be used as programmer-defined identifiers. Some standard keywords are: auto extern Sizeof Break floatn static case for void char
Some C compilers may recognize other keywords. Note that the keywords are all lowercase. Since uppercase and lowercase characters are not equivalent, it is possible to utilize an uppercase keyword as an identifier. Normally, however, this is not done, as it is considered a poor programming practice.
Programming in C