String Literals

String literals are similar to that character literals, except that they can store multiple characters and uses a double quote to store the same. It can also accommodate the special characters and escape sequences mentioned in the table above. We can break a long line into multiple lines using string literal and can separate them with the help of white spaces.
Example:

char stringVal[] = "w3wiki";

Example:

C




#include <stdio.h>
 
int main()
{
    const char str[]
        = "Welcome\nTo\nGeeks\tFor\tGeeks";
    printf("%s", str);
    return 0;
}


Output:

Welcome
To
Geeks    For    Geeks

Must Read:



Literals in C

In C, Literals are the constant values that are assigned to the variables. Literals represent fixed values that cannot be modified. Literals contain memory but they do not have references as variables. Generally, both terms, constants, and literals are used interchangeably. 
For example, “const int = 5;“, is a constant expression and the value 5 is referred to as a constant integer literal.

Similar Reads

Types of C Literals

There are 4 types of literal in C:...

1. Integer Literals

Integer literals are used to represent and store the integer values only. Integer literals are expressed in two types i.e....

2. Floating-Point Literals

...

3. Character Literals

These are used to represent and store real numbers. The real number has an integer part, real part, fractional part, and exponential part. The floating-point literals can be stored either in decimal form or exponential form. While representing the floating-point decimals one must keep two things in mind to produce valid literal:...

4. String Literals

...