ReDim in C#? 
Author Message
 ReDim in C#?

Hi guys.
Is there any equivalent technique to ReDim in C#?

TIA



Fri, 31 Dec 2004 01:26:19 GMT  
 ReDim in C#?
No. You need to reallocate array.

This posting is provided "AS IS" with no warranties, and confers no rights


Quote:
> Hi guys.
> Is there any equivalent technique to ReDim in C#?

> TIA



Fri, 31 Dec 2004 03:13:38 GMT  
 ReDim in C#?
use the ArrayList class?


Fri, 31 Dec 2004 03:35:22 GMT  
 ReDim in C#?
ArrayList class, I guess I will go for that.
Thank you for your suggestion!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 31 Dec 2004 05:04:56 GMT  
 ReDim in C#?
Andrew and Rich gave you 2 options:

1. int[] x=int[5];
   // use it
   x=int[10]; // that's redim equivalent
   // use it

2. ArrayList x=new ArrayList();
   x.Add(100);
   x.Add(5);

Second one more elegant, becouse it need no explicit
reallocation, but element extracting of it need explicit
cast to int. Of course, you can write your own strongly
typed collection class.



Fri, 31 Dec 2004 15:24:23 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. ReDim in C#?

2. VB6 Redim equivalent in C#

3. multi-dim Array Redim question

4. Redim Preserve

5. REDIM array(x,y,...): C implementation of BASIC FUNCTION

6. How to use Redim a safearray hold 2D Strings

7. Safearray Redim and Copy questions

8. SAFEARRAY and Redim (VC++) !!!HELP!!!

9. how to redim array?

10. SafeArray won't redim

11. ReDim Preserve

12. Redim Preserve and With...End With

 

 
Powered by phpBB® Forum Software