By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,448 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

Syntax question

P: n/a
I am trying to pass a reference to an array to another function. Something
like:
int x = ReadArray(myVars.theArray);

private int ReadArray(Array ar)
{
return ar[2, 2]
}

I can't seem to get it to except the reference passed.
Any help is greatly appreciated.
Mar 27 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Joe
Greg,

Try:
int ReadArray(Array []ar)
{
return ar[2, 2];
}

-Joe

"Greg Smith" <gj*@umn.edu> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
I am trying to pass a reference to an array to another function. Something
like:
int x = ReadArray(myVars.theArray);

private int ReadArray(Array ar)
{
return ar[2, 2]
}

I can't seem to get it to except the reference passed.
Any help is greatly appreciated.

Mar 27 '06 #2

P: n/a
Hi,

int R( int[,] a) { return a[0,0];}
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Greg Smith" <gj*@umn.edu> wrote in message
news:uD**************@TK2MSFTNGP12.phx.gbl...
I am trying to pass a reference to an array to another function. Something
like:
int x = ReadArray(myVars.theArray);

private int ReadArray(Array ar)
{
return ar[2, 2]
}

I can't seem to get it to except the reference passed.
Any help is greatly appreciated.

Mar 27 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.