c++ - What's the difference between namespaces & classes? -
In C ++ 13/4 environment, what is the difference between a namespace and a square?
The way I see it;
named place foo {int a: 4; Int b: 4; }
and
class bar {public: int a = 0; Int b = 0; }
The same thing ...
Yes, they are used differently;
Namespace ....
foo :: a = 20; Foo :: b = 30;
class ....
bar alpha; Alpha. A ... Alpha B ...
But in general, what is the advantage of one over the other?
There are a lot of differences, there is a group system for namespace names, more or nothing less
And so on.
If you think yourself whether you should use namespace or a class, then you are probably exploring a way to control the scope of names - so the election is clear: Nameshot's Use the.
Comments
Post a Comment