none
Array boundary RRS feed

  • Question

  • Hi,

    I have written a set of code which will create a array. I saw few functions under System.Array abstract class but I struggled to get an idea about that

    CODE:

    Array arrayObj = Array.CreateInstance(typeof(Player), new[] { 3 }, new[] { 7 });
    arrayObj.SetValue(new Player(1), 7);

    Console.WriteLine(" {0} {1} {2} {3}", arrayObj.GetLowerBound(0), arrayObj.GetUpperBound(0), arrayObj.Length, arrayObj.Rank);

    My question is

    -> why should i pass zero(0) to GetLowerBound and GetUpperBound functions? what is the purpose ?

    -> GetLowerBound and GetUpperBound are two functions which are extern. my idea about extern functions are if program is written in c,c++ and some other languages i can use that functions by importing DLLImport attribute. So I dig into this Array abstract class using Reflector but I didn't see any DllImport , which dll has these functions?

    kindly any one help me....

    Monday, January 21, 2013 5:49 AM

Answers

All replies