Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) raw string

 

A raw string is a type of string literal that has no escape sequences.

 

const std::string s = R"(/\/\/\/\)"

 

Use raw strings for string literals with complicated uses of backslash [1].

 

 

 

 

 

Examples

 

 

 

 

 

 

References

qt

 

  1. Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 7.8. Advice, page 199: '[8] Use raw strings for string literals with complicated uses of backslash'

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict