Click here to Skip to main content
15,949,686 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get very continuous random numbers Pin
Guffa2-Jul-06 11:48
Guffa2-Jul-06 11:48 
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 
But you have to create a new array for each item. A hash table is not capable of storing array values directly, you have to put the values in an array and store the reference to the array in the hash table.

I believe that you are not aware of where exactly you are creating the array.

The code:

int[] y = { 1, 2, 3 };

is the short form of:

int[] y = new int[] { 1, 2, 3 };

which is the same as:

int[] y;<br />
y = new int[] { 1, 2, 3 };


So, in that statement you are declaring a variable that can hold a reference to an array, then you create the array and store the reference in the variable.

If you want to make a copy of an array, you can use the Clone method. As long as the data in the array is a value type, it will create a fully independent copy of the array.

The Clone method returns an object reference, so you have to cast it to the correct type:

int[] y = { 1, 2, 3 };<br />
int[] z = (int[])y.Clone();



---
b { font-weight: normal; }

AnswerRe: Arrays in Hashtables Pin
Nader Elshehabi2-Jul-06 1:56
Nader Elshehabi2-Jul-06 1:56 
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 

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.