Click here to Skip to main content
15,509,982 members
Home / Discussions / C#
   

C#

 
GeneralReferring to a 2D array through a 1D array Pin
crushinghellhammer26-Jan-04 7:50
crushinghellhammer26-Jan-04 7:50 
GeneralRe: Referring to a 2D array through a 1D array Pin
Anonymous26-Jan-04 9:21
Anonymous26-Jan-04 9:21 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer26-Jan-04 15:25
crushinghellhammer26-Jan-04 15:25 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart26-Jan-04 10:06
protectorHeath Stewart26-Jan-04 10:06 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer26-Jan-04 15:37
crushinghellhammer26-Jan-04 15:37 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart27-Jan-04 3:46
protectorHeath Stewart27-Jan-04 3:46 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 9:21
crushinghellhammer27-Jan-04 9:21 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 9:23
crushinghellhammer27-Jan-04 9:23 
Heath, thanks for your detailed replies!

Ok, here's what I've done, incorporating your suggestions and that of my anonymous helper.

public class Segmentation
{
private static void Main()
{
Random R = new Random();

int[] inArray = new int[1280];

for(int i = 0; i < 1280; i++)
inArray[i] = i;

int[][] arrSegmentArray = new int[17][];

for(int i = 0; i < 17; i++)
{
arrSegmentArray[i] = new int[256];
Array.Copy(inArray, 64*i, arrSegmentArray[i], 0, 256);
Console.WriteLine(arrSegmentArray[i].ToString());
Console.ReadLine();
}

}

}

However, where I expect arrSegmentArray[i] to be printed as a 256 element array, all I see is System.Int32[];

What do I need to fix here? Frown | :(
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart27-Jan-04 9:58
protectorHeath Stewart27-Jan-04 9:58 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 10:01
crushinghellhammer27-Jan-04 10:01 
GeneralRe: Referring to a 2D array through a 1D array Pin
Heath Stewart27-Jan-04 10:08
protectorHeath Stewart27-Jan-04 10:08 
GeneralRe: Referring to a 2D array through a 1D array Pin
crushinghellhammer27-Jan-04 9:50
crushinghellhammer27-Jan-04 9:50 
GeneralPreview in Open Dialog box Pin
Shree26-Jan-04 7:23
Shree26-Jan-04 7:23 
GeneralRe: Preview in Open Dialog box Pin
Heath Stewart26-Jan-04 9:43
protectorHeath Stewart26-Jan-04 9:43 
GeneralUploading Images Pin
srt726-Jan-04 5:36
srt726-Jan-04 5:36 
GeneralRe: Uploading Images Pin
Mazdak26-Jan-04 5:52
Mazdak26-Jan-04 5:52 
GeneralRe: Uploading Images Pin
Mazdak26-Jan-04 5:57
Mazdak26-Jan-04 5:57 
GeneralRe: Uploading Images Pin
srt726-Jan-04 7:36
srt726-Jan-04 7:36 
GeneralRe: Uploading Images Pin
Mazdak26-Jan-04 7:52
Mazdak26-Jan-04 7:52 
Generalthreading in c# Pin
eman galal26-Jan-04 4:44
eman galal26-Jan-04 4:44 
GeneralRe: threading in c# Pin
Heath Stewart26-Jan-04 5:20
protectorHeath Stewart26-Jan-04 5:20 
GeneralExit from main Pin
thomasa26-Jan-04 4:08
thomasa26-Jan-04 4:08 
GeneralRe: Exit from main Pin
Heath Stewart26-Jan-04 4:13
protectorHeath Stewart26-Jan-04 4:13 
GeneralRe: Exit from main Pin
thomasa26-Jan-04 4:49
thomasa26-Jan-04 4:49 
GeneralRe: Exit from main Pin
Heath Stewart26-Jan-04 5:08
protectorHeath Stewart26-Jan-04 5:08 

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.