Explain string constants in c language - escape sequences, C/C++ Programming

Assignment Help:

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.


Related Discussions:- Explain string constants in c language - escape sequences

C program to swap two numbers using reference arguments, Aim: To implement...

Aim: To implement a program to swap two numbers using reference arguments. Code: void swap(int *a, int *b) {             int temp;             temp=*a;

Memory management by c program, Memory management by c program: Write ...

Memory management by c program: Write a program to memory management in c program unsigned max( unsigned, unsigned );   int BaseMemBlocks::allocBlock( size_t sz )

Define functions with arguments and no return values, Define Functions with...

Define Functions with arguments and no return values The calling function will read a data from the terminal and pass it on to called as function and this will work good as the

Prepare aime crossover alert expert adviso, Prepare aime crossover alert ex...

Prepare aime crossover alert expert adviso Project Description: Need to develop an expert advisor base on aime crossover alert indicator. Skills required is C Programming

Explain syntax rules for writing constructor functions, Syntax rules for wr...

Syntax rules for writing constructor functions Its name must be similar as that of the class to which it belongs. It is declared with no return type (not even void). Ho

Charity Ball Organizer, Charity Ball Organizer Many charities support g...

Charity Ball Organizer Many charities support good causes, but one of the difficulties each of them has is organizing their fundraising events. After nearly a semester of C pro

Explain protected and public in c++, Explain protected, public, private in ...

Explain protected, public, private in C++? These are three access spaecifiers in C++. - Public - Here data members and functions are accessible outside the class. - Pr

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd