I have a form1.cs file where I am trying to call a sorting
function from a SortingAlgorith ms.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.SortingAlgo rithms; //at top of form1.cs
In private void Form1_Load(para ms here)
{
//define A[10] here
Sorts s = new Sorts();
s.SelectionSort (A) // does not work
.SelectionSort( A) // does not work
}
In SortingAlgorith m.cs module
namespace DSM.SortingAlgo rithms
{
Sorts
{
public static void SelectionSort(i nt [] A)
{
//do stuff here
}
//other algorithms
};
}
function from a SortingAlgorith ms.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.SortingAlgo rithms; //at top of form1.cs
In private void Form1_Load(para ms here)
{
//define A[10] here
Sorts s = new Sorts();
s.SelectionSort (A) // does not work
.SelectionSort( A) // does not work
}
In SortingAlgorith m.cs module
namespace DSM.SortingAlgo rithms
{
Sorts
{
public static void SelectionSort(i nt [] A)
{
//do stuff here
}
//other algorithms
};
}
Comment