0

Hi guys,
I need help on getting the minimal scope on something.
I am learning data structures, right now i'm figuring out how to insert my class information (strings, ints, floats) into my node class.

Do i need to send data to my node each by each type?

or is there a way to encapsulate everything and send it?

I'm just looking for a web page, please don't think i'm asking for code, thanks in advance

Edited by claudiordgz: n/a

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by thelamb
0

It could be me, but I really don't understand what you're asking - could you be more specific please?

Edited by thelamb: n/a

0

I want to insert my class instance in a node (the whole information), i want to know how to do it. Please I know its too much too ask, that is why I just want a pointer (see what i did there?) to some webpage or a chapter in a book.

I have a node class and a linkedlist class.

0

Pointers! My book chapter was weak on pointers, but another book had some excellent info on them.

Of course if anyone has comments to help me they are most welcome.

1

You can add an instance of a class just like any other variable:

class B
{
   int m_one;
   string m_two;
};
class A
{
   B instB;
};

Or if you just want a pointer to B:

class A
{
   B* instB;
public:
   A( const B& b )
   {
        instB = &b;
   }
};

Hope that is what you meant.

Edited by thelamb: n/a

Votes + Comments
Thanks!!
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.