explain string constants in c language - escape


Explain string constants in c language - Escape Sequences?

Illustrations are "945", "hello", "well done", "5+3". The character constant (example 'x') isn't equivalent to the string constant (example"X"). Further a single character string constant doesn't have an equivalent integer value while a character has an integer value. Every string constant always ends with a special character '\0'. This character acts as the string terminator. The string of character used in a string constant is for all time stored in an adjacent memory location. C supports some backslash character constants that are used in output functions like printf.

            \n         -           stands for new line

            \b         -           back space

            \t          -           horizontal tab

            \0         -           null

            \v         -           Vertical Tab

            \r          -           Carriage Return

            \f          -           Form feed

            \a         -           Audible Alert (bell)

            \\          -           Backslash

            \?         -           Question mark

            \'          -           Single quote

            \"          -           Double quote

            \000     -           Oct Number

            \xhh     -           Hex number

Every one of these represents one character although they consists two characters and these combinations are called escape sequences.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: explain string constants in c language - escape
Reference No:- TGS0304629

Expected delivery within 24 Hours