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

What are the different types of endless loops, What are the different types...

What are the different types of endless loops? An endless loop can be of two types: i.) A loop that is intentionally designed to go round and round until the condition withi

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

C program to define power of a function, C program to define power of a fun...

C program to define power of a function: Write a program to use power of a function. void main() { int x,y,po=1,i,j; clrscr();   printf("Give x,y\n"); sca

Loops, Create a program that will accept 3 numbers. The first number (num1)...

Create a program that will accept 3 numbers. The first number (num1) is the common difference and the second number (num2) is the starting number and the 3rd number (num3) is the m

Control structures in cpp, C o n t r o l S t r u c t u r e s ...

C o n t r o l S t r u c t u r e s I t i s o f t h r e e t y p e s: 1 .    S e qu e n c e s t r u c t u r e 2 .

Programs that perform the identical recursive algorithm, Goals For this ass...

Goals For this assignment you will write programs in C and LC-3 assembly code. Both programs will perform the identical recursive algorithm. The goals of this programming assignmen

Program create a user defined data structure - c++ program, Create a user-d...

Create a user-defined data structure (struct) called Node that represents a node within a linked list where the "data" stored in each node is a pointer to a Car object.    a) Wr

Homework, 5 questions. plus i will provide the "vector.h" for the questions...

5 questions. plus i will provide the "vector.h" for the questions that needs it

How many non-boundary pits and peaks are on the map, Armed with your functi...

Armed with your function from above, we can do some interesting things. For instance, any pixel where the offsets are both zero is a pit (lower than all surrounding points) .

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