Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TempusElf

Linked List in VB

This topic is 6002 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In school ive learned to make linked lists using C++ and i want to use one in a project that im working on in Visual Basic. I have two class modules one for a linked list, one for a node. I guess my problem is that i don''t understand how "pointers" work in VB (i know they aren''t really pointers but i don''t know what else to call them) heres what im confused about at the moment: in C++ when you''ve removed a node from a list and you''re done with it you''d say "delete nodepointer" to avoid memory leaks... whats the VB equivalent of this? is there one?

Share this post


Link to post
Share on other sites
Advertisement
Use a collection if you can

quote:

whats the VB equivalent of this? is there one?


set obj = nothing

VB and Java both have pointers, they just don''t call them that. In Java "references" can be null, which means they''re not references at all, they''re pointers to garbage collected objects. In VB, variables dimensioned to be objects are really (semi) smart pointers to COM interfaces, and can be Nothing (i.e. Null).


Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]

[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ ]

Shamelessly ripped from Oluseyi

Share this post


Link to post
Share on other sites
Why on earth do you need a linked list in VB??? You have those wonderfull resizeable arrays to play with

I just make a big array of UDTs with an enabled flag. when I want to add an item I search the array for an empty spot. it works very well

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!