John Scott
2008-05-15 13:54:09 UTC
I can create an instance of a class, say, Counter for example, as follows.
Counter *C1 = new Counter.
and everything is fine.
However, I get a compiler error when I call a function and try to make more
than one instance. For example
SomeFunction( )
{
static int z = 0;
Counter *C(z) = new Counter;
}
Could anyone please explain what I am doing wrong or if there is another way
of achieving the same result.
Many Thanks.
Counter *C1 = new Counter.
and everything is fine.
However, I get a compiler error when I call a function and try to make more
than one instance. For example
SomeFunction( )
{
static int z = 0;
Counter *C(z) = new Counter;
}
Could anyone please explain what I am doing wrong or if there is another way
of achieving the same result.
Many Thanks.