C Menu


The C Character Set




To develop a program what fundament components are required those are called characteristics of C

The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier.

Character set of C Language

  • Letters : A to Z and a to z
  • Digits : 0 to 9
  • Special characters : *, @, # ......etc.
  • White space characters: Enter key(\n), tab space key(\t), space key ( −), back space key (‘\b’)....etc.

Token

Smallest individual unit of a program is known as token.

  • Keywords
  • Identifiers
  • Constants

Keywords

Keywords are the words whose meaning has already been explained to the C compiler. The keywords cannot be used as Identifiers because if we do so we are trying to assign a new meaning to the keyword, which is not allowed by the computer.

There are only 32 keywords available in C.

auto double int struct
break else long switch
case enum register typedef
char extern return union
const float short unsigned
continue for signed void
default goto sizeof volatile
do if static while

Identifiers

Identifier refers to name given to entities such as variables, functions, structures etc.

Identifiers must be unique. They are created to give a unique name to an entity to identify it during the execution of the program

Note:identifier names must be different from keywords

Rules for naming identifiers

  • A valid identifier can have letters (both uppercase and lowercase letters), digits and underscores.
  • The first letter of an identifier should be either a letter or an underscore.
  • No commas or blanks are allowed.
  • Do not create unnecessarily long names(not more than 31 characters) as it adds to your typing effort.

Constants

In C language constants refers to fixed values that do not change during execution of the program

  • Numeric Constants
    • Integer constants
    • Real constants
  • Charater Constants
    • Single Chatacter constants
    • String constants
    • Backslash char constants

Backslash character constant

They are also known as escape sequence character constants. They are used to have formatted output.

The below table shows different types of escape sequence characters available in C language

Constant Meaning
\a (Beep sound) Gives beep sound in printing results on output screen.
\b (Backspace) Prints the output one space back
\f Form Feed Gives the form feed
\n New Line Prints the output in new line
\r Carriage Return Cursor is returned to the required place
\t Tab (Horizontal) Prints tabspace on the output screen
\v Vertical Tab Prints tabspace vertically
\\ Backslash Prints the backslash
\´ Single Quote Prints the single quoute
\" Double Quote Prints the double quote
\? Question Mark Prints the question mark
\0 Null Used to terminate the string

Next Topic :Variables