D
David Miller
I have a form1.cs file where I am trying to call a sorting
function from a SortingAlgorithms.cs file. They are part
of the same solution, but even when I make the
SelectionSort algorithm public static, it does not appear
in the intellisense, not does it let me call it. I tried
even instantiating an object of type Sorts, the name of my
class, but that did not help. Also, I added the namespace
for the Sorts class to the top of my form1.cs class.
How do I call the SelectionSort from class Sorts.
Following is some code snippets:
In form1.cs class:
using DSM.SortingAlgorithms; //at top of form1.cs
In private void Form1_Load(params here)
{
//define A[10] here
Sorts s = new Sorts();
s.SelectionSort(A) // does not work
.SelectionSort(A) // does not work
}
In SortingAlgorithm.cs module
namespace DSM.SortingAlgorithms
{
Sorts
{
public static void SelectionSort(int [] A)
{
//do stuff here
}
//other algorithms
};
}
function from a SortingAlgorithms.cs file. They are part
of the same solution, but even when I make the
SelectionSort algorithm public static, it does not appear
in the intellisense, not does it let me call it. I tried
even instantiating an object of type Sorts, the name of my
class, but that did not help. Also, I added the namespace
for the Sorts class to the top of my form1.cs class.
How do I call the SelectionSort from class Sorts.
Following is some code snippets:
In form1.cs class:
using DSM.SortingAlgorithms; //at top of form1.cs
In private void Form1_Load(params here)
{
//define A[10] here
Sorts s = new Sorts();
s.SelectionSort(A) // does not work
.SelectionSort(A) // does not work
}
In SortingAlgorithm.cs module
namespace DSM.SortingAlgorithms
{
Sorts
{
public static void SelectionSort(int [] A)
{
//do stuff here
}
//other algorithms
};
}