PC Review


Reply
Thread Tools Rate Thread

Declaration problem

 
 
Soske
Guest
Posts: n/a
 
      5th Sep 2003
Hi

I'm creating binary tree and i have my own structure with variables parent,
leftchild, rightchild:

Public Structure Node
Public Parent As Object
Public LeftChild As Object
Public RightChild As Object
 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      5th Sep 2003
"Soske" <(E-Mail Removed)> schrieb:
> I'm creating binary tree and i have my own structure with
> variables parent, leftchild, rightchild:
>
> Public Structure Node
> Public Parent As Object
> Public LeftChild As Object
> Public RightChild As Object
> .
> .
> .
> End Structure
>
> I need to hold only references to objects in teese variables.


Notice that structures are value types.

Use something like this instead:

\\\
Public Class Node
Public Parent As Node
Public LeftChild As Node
Public RightChild As Node
End Class
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Array Declaration Problem ?? monir Microsoft Excel Programming 21 30th Jun 2008 05:21 PM
Declaration problem davidm Microsoft Excel Programming 0 23rd Aug 2005 03:06 AM
VBA Declaration problem =?Utf-8?B?U2hhd24=?= Microsoft Excel Programming 2 17th Jul 2005 10:44 PM
Variable Declaration Problem? Anthony Viscomi Microsoft Access 2 17th Sep 2004 01:37 PM
Variable Declaration Problem =?Utf-8?B?amNyb3VzZQ==?= Microsoft VB .NET 6 1st Jun 2004 03:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:32 PM.