In function main variable i is a local variable of the function. It is not visible and exists outside the function.
Consider the following example
#include <iostream>
int i = 3;
int main()
{
int i = 10
std::cout << "i = " << i << std::endl;
std::cout << "::i = " << ::i << std::endl;
i = ::i;
std::cout << "i = " << i << std::endl;
std::cout << "::i = " << ::i << std::endl;
{
int i = 20;
std::cout << "i = " << i << std::endl;
std::cout << "::i = " << ::i << std::endl;
}
std::cout << "i = " << i << std::endl;
std::cout << "::i = " << ::i << std::endl;
}
Local variables have no linkage.