Object of a "predefined" class...

Hi,

I have a question ... Is it right that I can "pre-define" a class (don't know the correct term) such as below?

class Test;

class Test {

Test();
funktion1();
funktion2();

};

Can I create a static object after I've "pre-defined"the class test (see below)?

class Test;

static Test * test;

class Test {

Test ();
function1 ();
function2 ();

};

and then initialize the object in the .ccp-file with

Test * Test::test = NULL;

??? Thanks for any help ...
That is called declaring.
After declaring a class you can declare pointers and references to it.
One reason to do this would be
1
2
3
4
5
struct B;

struct A{ B* b; };

struct B{ A* a; };


You can't use keyword static in global scope.
Topic archived. No new replies allowed.