DrDolittle
Full Member level 3
- Joined
- Sep 24, 2004
- Messages
- 162
- Helped
- 5
- Reputation
- 10
- Reaction score
- 1
- Trophy points
- 1,298
- Location
- Within arm's reach
- Activity points
- 1,443
class intnode
{
public:
int info;
intnode *next; // this is the part i wanted to know
intnode(int i, intnode *in=0)
{
info = i;next = in;
}
};
you can ignore what is in the loop. As the comments denote, that is the part i wanted explanation for. info and next are data members of the class intnode. But how is it possible to define the class in terms of itself. Can somebody explain this ? i would very much appreciate if someone could come up with more examples. Tack!(thanks)
Regards
drdolittle
{
public:
int info;
intnode *next; // this is the part i wanted to know
intnode(int i, intnode *in=0)
{
info = i;next = in;
}
};
you can ignore what is in the loop. As the comments denote, that is the part i wanted explanation for. info and next are data members of the class intnode. But how is it possible to define the class in terms of itself. Can somebody explain this ? i would very much appreciate if someone could come up with more examples. Tack!(thanks)
Regards
drdolittle