C++ examples for Data Type:const
Using a properly initialized constant variable.
#include <iostream> using namespace std; int main() // w ww.j av a2s. c o m { const int x = 7; // initialized constant variable cout << "The value of constant variable x is: " << x << endl; }