Raw String Literal in C++ Last Updated : 27 Jan, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report A Literal is a constant variable whose value does not change during the lifetime of the program. Whereas, a raw string literal is a string in which the escape characters like ' \n, \t, or \" ' of C++ are not processed. Hence, a raw string literal that starts with R"( and ends in )". The syntax for Raw string Literal: R "delimiter( raw_characters )delimiter" // delimiter is the end of logical entity Here, delimiter is optional and it can be a character except the backslash{ / }, whitespaces{ }, and parentheses { () }. These raw string literals allow a series of characters by writing precisely its contents like raw character sequence. Example: Ordinary String Literal "\\\\n" Raw String Literal \/-- Delimiter R"(\\n)" /\-- Delimiter Difference between an Ordinary String Literal and a Raw String Literal: Ordinary String LiteralRaw String LiteralIt does not need anything to be defined.It needs a defined line{ parentheses ()} to start with the prefix R.It does not allow/include nested characters.It allows/includes nested character implementation.It does not ignore any special meaning of character and implements their special characteristic.It ignores all the special characters like \n and \t and treats them like normal text. Example of Raw String Literal: CPP // C++ program to demonstrate working of raw string literal #include <iostream> using namespace std; // Driver Code int main() { // A Normal string string string1 = "Geeks.\nFor.\nGeeks.\n"; // A Raw string string string2 = R"(Geeks.\nFor.\nGeeks.\n)"; cout << string1 << endl; cout << string2 << endl; return 0; } OutputGeeks. For. Geeks. Geeks.\nFor.\nGeeks.\n Time Complexity: O(n) Space complexity: O(n) Comment More infoAdvertise with us Next Article Literals in C++ K kartik Improve Article Tags : C++ cpp-string Practice Tags : CPP Similar Reads Literals in C++ In C++ programming language, literals are fundamental elements used to represent fixed values. These values can include numbers, characters, strings, and more. They are generally present as the right operand in the assignment operation.Let's take a look at an example:C++#include <iostream> usi 6 min read list::operator= in C++ STL Lists are containers used in C++ to store data in a non contiguous fashion, Normally, Arrays and Vectors are contiguous in nature, therefore the insertion and deletion operations are costlier as compared to the insertion and deletion option in Lists. list::operator= This operator is used to assign n 2 min read Strings in C++ In C++, strings are sequences of characters that are used to store words and text. They are also used to store data, such as numbers and other types of information in the form of text. Strings are provided by <string> header file in the form of std::string class.Creating a StringBefore using s 5 min read Strings in C++ In C++, strings are sequences of characters that are used to store words and text. They are also used to store data, such as numbers and other types of information in the form of text. Strings are provided by <string> header file in the form of std::string class.Creating a StringBefore using s 5 min read std::to_string in C++ In C++, the std::to_string function is used to convert numerical values into the string. It is defined inside <string> header and provides a simple and convenient way to convert numbers of any type to strings.In this article, we will learn how to use std::to_string() in C++.Syntaxstd::to_strin 1 min read User Defined Literals in C++ A literal is used for representing a fixed value in a program. A literal could be anything in a code like a, b, c2. , 'ACB', etc. Similarly, User-Defined Literals (UDL) provides literals for a variety of built-in types that are limited to integer, character, floating-point, string, boolean, and poin 3 min read Like