Makaleks2014-09-16 18:18:57
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)
Melkij, 2016-09-08

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.

Konstantin Stepanov, 2016-09-08

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.

solalex, 2016-09-08

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.

lookid, 2014-09-16

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.

Trrrrr, 2014-09-16

The word static has many meanings.
Read the description here for example:

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question