Cyclone
Cyclone

Reputation: 18295

Getting the value of an int array at an index in c#

I want to get the value of my integer array, at an index. The GetValue method refuses the int type.

What am I doing wrong?

return locX.GetValue(Ind);

Ind is an integer, locX is declared like: public int[] locX;

I know I am doing SOMETHING wrong. Sorry for the noobiness of this question, I am kinda new to c#.

Upvotes: 0

Views: 169

Answers (2)

Rohith
Rohith

Reputation: 2091

Did you try locX[Ind]?

Upvotes: 4

shahkalpesh
shahkalpesh

Reputation: 33474

return locX[Ind];

Upvotes: 1

Related Questions