What is namespace?

Date: Fri-Jun-17-2016-
Response
2
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.

Date: Fri-Jun-17-2016
Response
0
Inheritance is the process of creating new classes, called derived

classes, from

existing classes or base classes. The derived class inherits all the

capabilities of the

base class, but can add embellishments and refinements of its own.

Date: Fri-Jun-17-2016
Response
What is 1 + 100



Just Updated::