Search Results

Search found 2 results on 1 pages for 'gagar1n'.

Page 1/1 | 1 

  • Dynamically created jagged rectangular array

    - by gagar1n
    In my project I have a lot of code like this: int[][] a = new int[firstDimension][]; for (int i=0; i<firstDimension; i++) { a[i] = new int[secondDimension]; } Types of elements are different. Is there any way of writing a method like createArray(typeof(int), firstDimension, secondDimension); and getting new int[firstDimension][secondDimension]? Once again, type of elements is known only at runtime.

    Read the article

  • Dynamically created jagged "rectangle" array

    - by gagar1n
    In my project I have a lot of code like this: int[][] a = new int[firstDimension][]; for (int i=0; i<firstDimension; i++) { a[i] = new int[secondDimension]; } Types of elements are different. Is there any way of writing a method like createArray(typeof(int), firstDimension, secondDimension); and getting new int[firstDimension][secondDimension]? Once again, type of elements is known only at runtime.

    Read the article

1