Click here to Skip to main content
15,904,653 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get very continuous random numbers Pin
mav.northwind2-Jul-06 23:30
mav.northwind2-Jul-06 23:30 
QuestionMessage Removed Pin
2-Jul-06 4:35
Mandai2-Jul-06 4:35 
AnswerRe: Asking a question Pin
Ravi Bhavnani2-Jul-06 4:55
professionalRavi Bhavnani2-Jul-06 4:55 
QuestionArrays in Hashtables Pin
Mazze.ger1-Jul-06 23:17
Mazze.ger1-Jul-06 23:17 
AnswerRe: Arrays in Hashtables Pin
Guffa1-Jul-06 23:51
Guffa1-Jul-06 23:51 
GeneralRe: Arrays in Hashtables Pin
Mazze.ger2-Jul-06 1:34
Mazze.ger2-Jul-06 1:34 
AnswerRe: Arrays in Hashtables Pin
Guffa2-Jul-06 1:49
Guffa2-Jul-06 1:49 
AnswerRe: Arrays in Hashtables Pin
Nader Elshehabi2-Jul-06 1:56
Nader Elshehabi2-Jul-06 1:56 
Hello
Your mistake in Example2 was changing the values of the same array, which eventually will change in the HashTable too.

Proposed solution:
Dynamically allocate another Array using the same name:
eg.

Hashtable x = new Hashtable();
int[] y = { 1, 2, 3 };
x["1"] = y;
y = new int[] { 4, 5, 6 };
x["2"] = y;
MessageBox.Show(((int[])x["1"])[1].ToString());
MessageBox.Show(((int[])x["2"])[1].ToString());


PS.
Beware of the Garbage CollectorBig Grin | :-D

RegardsRose | [Rose]
GeneralRe: Arrays in Hashtables Pin
Mazze.ger2-Jul-06 2:17
Mazze.ger2-Jul-06 2:17 
Questionhow ot Windows Service Pin
foysal mamun1-Jul-06 21:35
foysal mamun1-Jul-06 21:35 
AnswerRe: how ot Windows Service Pin
Nader Elshehabi2-Jul-06 1:43
Nader Elshehabi2-Jul-06 1:43 
AnswerRe: how ot Windows Service Pin
Ravi Bhavnani2-Jul-06 4:57
professionalRavi Bhavnani2-Jul-06 4:57 
AnswerRe: how ot Windows Service Pin
Paul Conrad2-Jul-06 12:52
professionalPaul Conrad2-Jul-06 12:52 
QuestionCapturing video from webcam using .NET Pin
dmee1-Jul-06 20:33
dmee1-Jul-06 20:33 
AnswerRe: Capturing video from webcam using .NET Pin
Ed.Poore1-Jul-06 23:23
Ed.Poore1-Jul-06 23:23 
NewsRe: Capturing video from webcam using .NET Pin
LongRange.Shooter3-Jul-06 5:26
LongRange.Shooter3-Jul-06 5:26 
QuestionText file parsing Pin
Zeikcied1-Jul-06 19:17
Zeikcied1-Jul-06 19:17 
AnswerRe: Text file parsing Pin
tjvictor1-Jul-06 19:25
tjvictor1-Jul-06 19:25 
NewsRe: Text file parsing Pin
LongRange.Shooter3-Jul-06 5:35
LongRange.Shooter3-Jul-06 5:35 
GeneralRe: Text file parsing Pin
Zeikcied8-Jul-06 18:18
Zeikcied8-Jul-06 18:18 
NewsRe: Text file parsing Pin
LongRange.Shooter9-Jul-06 5:06
LongRange.Shooter9-Jul-06 5:06 
QuestionShow Form in Center Pin
foysal mamun1-Jul-06 18:25
foysal mamun1-Jul-06 18:25 
AnswerRe: Show Form in Center Pin
tjvictor1-Jul-06 19:15
tjvictor1-Jul-06 19:15 
GeneralRe: Show Form in Center Pin
tjvictor1-Jul-06 19:20
tjvictor1-Jul-06 19:20 
GeneralRe: Show Form in Center Pin
foysal mamun1-Jul-06 20:07
foysal mamun1-Jul-06 20:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.