C++ Variable hiding between local and global variable

Description

C++ Variable hiding between local and global variable

#include <iostream>
using namespace std;
double number = 42.8;       // a global variable named number
int main()//from w  w w  . j a  va  2 s.com
{
   double number = 26.4;     // a local variable named number
   cout << "The value of number is " << number << endl;
   return 0;
}



PreviousNext

Related