// file1.cpp
#include <iostream>
int i; // global, with external linkage
static int j; // global, without external linkage
extern int n; // global, defined somewhere else
namespace X
{
int i; // X::i
int f() // X::f()
{
i = n; // X::i = ::n;
return j; // ::j
}
void g(); // X::g()
}
namespace
{
int k; // ::k
}
void f()
{
int i; // local i
static int k; // local k
{
int j = i; // local j
int i = j; // local i
std::cout << i << j << k << X::i << ::k << ::i;
}
}
static void g()
{
++k; // ::k
}
void X::g() // X::g()
{
++i; // X::i
}