GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 30-Nov-2006, 10:32
Gix Gix is offline
New Member
 
Join Date: Sep 2006
Posts: 21
Gix is on a distinguished road

Array of objects of a managed class


Hi,

I have created a managed class and I want to make an array of this class, but I need it to be of not fixed length.

I can declare the array like this:
CPP / C++ / C Code:
	PC *Labtry[] = new PC *[50]; //where 50 is the length of the array

Is there a way to declare an array of not fixed length, and if there is how do I do it?

Thank you,

Gligor
  #2  
Old 20-Dec-2006, 02:50
aie0 aie0 is offline
Member
 
Join Date: Dec 2004
Posts: 246
aie0 is a jewel in the roughaie0 is a jewel in the rough

Re: Array of objects of a managed class


not in .net

Try ArrayList or something else from System.Collections namespace
  #3  
Old 20-Dec-2006, 04:27
erniegerdie erniegerdie is offline
Junior Member
 
Join Date: Feb 2004
Location: England
Posts: 84
erniegerdie has a spectacular aura abouterniegerdie has a spectacular aura about

Re: Array of objects of a managed class


Or I would suggest for your scenario creating a strongly typed collection, which you have to make yourself in 1.1 (derive from CollectionBase), in 2.0 upwards use generics (Collection<T> - where T is the object type)
 
 

Recent GIDBlogUS Elections and the ?Voter?s Responsibility? by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Message Class TransformedBG C++ Forum 5 29-Nov-2006 22:28
a tester class and then some. postage Java Forum 1 06-May-2006 16:48
Need help deleting the last element in the array headphone69 C++ Forum 2 15-Mar-2006 20:31
template comiling problems - need expert debugger! crq C++ Forum 1 01-Feb-2005 22:26
Error C2146: syntax error : missing ',' before identifier 'C4' mattchew008 C++ Forum 2 19-Dec-2004 07:06

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:55.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.