(C++) string literal
June 14, 2019 ยท View on GitHub
A string literal is a character sequence enclosed with double quotes [1]. A single character enclosed in single quotes is called a character literal [2]. Use raw strings for string literals with complicated uses of backslash [3].
Examples
References
-
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 7.3.2. String Literals, page 176
-
- Bjarne Stroustrup. The C++ Programming Language (4th edition). 2013. ISBN: 978-0-321-56384-2. Chapter 7.2.3.2. Character Literals, page 143
-
- 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'