C Programming Language

String constants

                 A string constant consists of zero or more character enclosed in quotation marks. Several string constants are given below.

       “Welcome to C Programming”                      “ ”

        “a+b\n”                                                          “Error\a\a\a”

                There is a difference between the constant ‘A’ and “A” in C, the first ‘A’ is a character constant while the second “A” is string constant. The notation ‘A’ is a constant occupying a single byte containing the ASCII code of the character A. The notation  “A”  on the other hand ,is a constant that occupies two bytes one for ASCII code of A and another for the null character with the value 0,that terminates all the string.

Example:

Character constants Home Variables

c program stats