Sunday, 18 August 2013

Static structure - definitions, objects, members

Static structure - definitions, objects, members

1.What is the use of static structure other than linkage?
static struct test //THIS ONE
{
int a;
};
2.What is the use of using static like this one? When i create this and
try use the static member (either through the structure object) it shows
"undefined reference to `test::a'"
struct test
{
static int a; //THIS ONE
};
3. What is the use of creating a static structure object?
struct test{
int a;
};
int main()
{
static test inst; //THIS ONE
return 0;
}

No comments:

Post a Comment