J'ai IMHO problème très étrange avec le constructeur de trois arguments, Lorsque je tente d'exécuter le programme visual studio me montre un seul bogue: "'Sort.HeapSort' ne contient pas un constructeur qui prend 3 arguments 112 35 ".C# étrange problème avec le constructeur
namespace Sort
{
class HeapSort
{
private int[] A;
private int heapSize;
private int min;
private int max;
Random myRandom = new Random();
HeapSort(int size, int min1, int max1) //this is the three argument constructor.
{
heapSize = size - 1;
min = min1;
max = max1;
A = new int[size];
}
}
class Program
{
static void Main(string[] args)
{
int size = 30;
int min = 0;
int max = 100;
HeapSort myHeapSort = new HeapSort(size,min,max); //In this line is the bug
}
}
}
Avez-vous essayé de déclarer le constructeur public? –
Pourriez-vous supprimer les lignes inutiles plz :) – ykatchou
peut-être vous devriez décorer vos classes avec les modificateurs d'accès appropriés. Public, privé, protégé, etc. – StingyJack