- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 C++ Integer Constants?
Integer constants are constant data elements that have no fractional parts or exponents. They always begin with a digit. You can specify integer constants in decimal, octal, or hexadecimal form. They can specify signed or unsigned types and long or short types.
In C++ you can use the following code to create an integer constant −
#include<iostream> using namespace std; int main() { const int x = 15; // 15 is decimal integer constant while x is a constant int. int y = 015; // 15 is octal integer constant while y is an int. return 0; }
You can find the complete grammar to specify integer constants on https://msdn.microsoft.com/en-us/library/00a1awxf.aspx.
Advertisements