Johnny Nguyen

Johnny Nguyen

  • NA
  • 6
  • 8.1k

List array

Apr 20 2011 3:45 AM
In the following code:
 public static void ExchangeSort(int[] array)
{
        int pass, i, n= array.Length;
        int tempt;
        for(pass=0; pass<n-1; pass++)
        {
                for( i= pass+1; i< n; i++)
                {
                        if(array[i]<array[pass])
                        {
                                tempt=array[pass];
                                array[pass]=array[i];
                                array[i]=tempt;
                        }
                }
        }
}


When I replace the parameter int[] array with List<int> array. the result in a syntax error. What should I do to fix the error but I would like to use List<int> array.



Regards 
Johnny


Answers (3)