Thursday, 19 September 2013

when allocate memory to variables defined in the namespace

when allocate memory to variables defined in the namespace

For example, assume a is a public static member in ClassA.
namespace SPACE{
ClassA::a=NULL;
ClassA::ClassA()
{
ClassA::a="initialized here";
}
}
So two questionF
when is a=NULL being invoked? Before main() or after that?
since a is a static member, why it can be defined twice with NULL and
ginitialized here"H

No comments:

Post a Comment