Popular Google Pages:
This article is regarding Use a Constant directly into C++ program, without declaring it?
Last updated on: 09th December 2016.
◕ What will happen if we use a Constant directly into the C++ program, without declaring it?
- When we use a Variable in C++ program, then the program declarations tell the C++ compiler about that Type of the Variable.
But we can use a Constant directly into the C++ program, without declaring it.
The example is given bellow:
using namespace std;
cout << "India: " << 1947 << endl;
The output is:
- In the above example we use a constant directly without declaring it.
◕ How C++ will decide what type of constant it is?
- C++ stores integer constants as int Type unless we declare it as Long or Unsigned.
How to display a value in Hexadecimal form in C++?
How to display a value in Octal form in C++?
How C++ identify the base of a number?
Top of the page