Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is namespace? C++
What is namespace? C++
✍: Guest
Namespaces allow us to group a set of global classes, objects and/or functions under a name. To say
it somehow, they serve to split the global scope in sub-scopes known
as namespaces.
The form to use namespaces is:
namespace identifier { namespace-body }
Where identifier is any valid identifier and namespace-body is the set of classes, objects and
functions that are included within the namespace. For example:
namespace general { int a, b; } In this case, a and b are normal variables integrated within the
general namespace. In order to access to these variables from outside the namespace we have to
use the scope operator ::. For example, to access the previous variables we would have to put:
general::a general::b
The functionality of namespaces is specially useful in case that there is a possibility that a global
object or function can have the same name than another one, causing a redefinition error.
2012-02-13, 3053👍, 0💬
Popular Posts:
How To Process Query Result in PL/SQL? - Oracle DBA FAQ - Introduction to PL/SQL You can run queries...
What Is Posting? Posting is an event that writes Inserts, Updates and Deletes in the forms to the da...
What is the benefit of using #define to declare a constant? Using the #define method of declaring a ...
How to create a thread in a program? You have two ways to do so. First, making your class "extends" ...
What is the version information in XML? “version” tag shows which version of XML is used.