 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What are literals in C++?
A literal is any notation for representing a value within the source code. They just exist in your source code and do not have any reference a value in memory. Contrast this with identifiers, which refer to a value in memory.
There are several types of literals in C++. Some of the examples of literals are −
- "Hello" (a string)
- 3.141 (a float/double)
- true (a boolean)
- 3 (an integer)
- 'c' (a character)
Things that are not literals −
- bar = 0; (a statement)
- 3*5-4 (an expression)
- std::cin (an identifier)
Advertisements
 