M
M
Makaleks2014-09-16 18:18:57
linux
Makaleks, 2014-09-16 18:18:57

Why don't static and namespace limit scope?

"If a global variable is declared with the specifier static, then the scope of this variable is limited to one file"
But in practice this does not happen. I can access a static global variable or a variable from an unnamed namespace from main(), all I have to do is type that file into #include
Why doesn't it work?
How right?
Visual Studio 2010

Answer the question

In order to leave comments, you need to log in

5 answer(s)
M
Melkij, 2016-09-08
@melkij

eth1 temporarily loses the link. Find out in the description of your router which interface eth1 corresponds to. If the real port is connected to RJ45 - check the connected cable and the connectors themselves, as well as the device at the other end of this cable. Now, if this is an internal port - then you have to think.

K
Konstantin Stepanov, 2016-09-08
@koronabora

Most likely, this is the wan port. The link sometimes jumps, ask the provider, he should have the same thing on the switches in the logs.
You can find out what this port is by going to the properties of the interface and there will be "Physical settings", it will say which eth belongs to which interface.

S
solalex, 2016-09-08
@solalex

Disable lan ports one by one, look at the system log. So you can easily determine which port is disabled. And it can turn off either due to poor contact, or damage to the cable, or the device that is connected to it briefly disconnects the link.

L
lookid, 2014-09-16
@Makaleks

the c++ compiler preprocessor replaces #include with the contents of a file that is written in <...> or "...". If you want to limit the scope, then write the implementation in cpp, not in h.

T
Trrrrr, 2014-09-16
@Trrrrr

The word static has many meanings.
Read the description here for example:
msdn.microsoft.com/ru-ru/library/s1sb61xd.aspx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question