what is :: called

Hi,

Can anybody tell me what is :: symbol called in C++?
scope
Scope resolution operator.
thankyou
Examples:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;

int a = 2; // global integer

namespace n 
{
  int a = 3; // namespace integer
}

class c
{
public:
  static const int a = 4; // class integer
};

int main()
{
    int a = 1; // local integer

    cout << a     // local scope (if available locally)
         << ::a   // global scope
         << n::a  // namespace scope
         << c::a  // class scope
         << endl;
}
1234
Last edited on
Topic archived. No new replies allowed.