Connecting Tech Pros Worldwide Forums | Help | Site Map

Passing a multidimensional array as a reference parameter???

vmsgman
Guest
 
Posts: n/a
#1: Nov 17 '05
int notneeded = ReadFile(ref defArry[,], sDefFile, w, h);

// Read File Contents into memory array and return for processing
public int ReadFile( ref ushort[,] nArray, string sFname, int w, int h)
{
FileStream fs = new FileStream(sFname, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
// Read data
for (int y=0; y<h; y++)
{
for (int x=0; x<w; x++)
{
nArray[x,y] = br.ReadUInt16();
}
}
br.Close();
fs.Close();
return 0;
}

Closed Thread