Page

Scope Resolution Operator In C++

#include <iostream.h>
#include <conio.h>
using namespace std;

char c = 'a';     //global variable

int main()
 {
  char c = 'b';    //local variable

  cout << "local c: " << c << "\n";      
  cout << "global c: " << ::c << "\n";  

  return 0;
}

No comments:

Post a Comment