Thread overview
pointer to class in class
Apr 20, 2004
Fabian
Apr 20, 2004
J Anderson
Apr 21, 2004
J C Calvarese
April 20, 2004
class Node
{
Node myPointer;

void test()
{
myPointer = new Node;
}
}

this doesnt work, it says its unidentified.
any ideas?


April 20, 2004
Fabian wrote:

>class Node
>{
>Node myPointer;
>
>void test()
>{
>myPointer = new Node;
>}
>}
>
>this doesnt work, it says its unidentified.
>any ideas?
>

You need an entry point (main)

void main()
{
//Code starts here
}


-- 
-Anderson: http://badmama.com.au/~anderson/
April 21, 2004
Fabian wrote:
> class Node
> {
> Node myPointer;
> 
> void test()
> {
> myPointer = new Node;
> }
> }
> 
> this doesnt work, it says its unidentified.
> any ideas?


This might work a little better:

class Node
{
    Node myPointer;

    void test()
    {
        myPointer = new Node;
    }
}

void main()
{
    Node n = new Node();
    n.test();
}

-- 
Justin
http://jcc_7.tripod.com/d/