anagm
asked on
correcting in the code snippet
What is wrong with this section of code, is it something to do with the naming, datatypes, the structure of comments.
someFunction(int[] a)
{
// print out entire array
for (int i = 0; i < a.Length - 1; i++)
label1.Text += a[i] + " "
for (int i = 0; i < a.Length - 1; i++)
{
string ff;
for (int j = 0 ; j < a.Length - 1, j++)
{
if (a[j] > a[j+1])
{
bTemp = a[j];
a[j] = a[j+1];
a[j+1] = bTemp;
}
}
}
/* print out entire array
for (int i = 0; i < a.Length; i++)
label2.Text += a[i].ToString() + " ";
}
any help would be appreciated
Thanks,
Anagm
someFunction(int[] a)
{
// print out entire array
for (int i = 0; i < a.Length - 1; i++)
label1.Text += a[i] + " "
for (int i = 0; i < a.Length - 1; i++)
{
string ff;
for (int j = 0 ; j < a.Length - 1, j++)
{
if (a[j] > a[j+1])
{
bTemp = a[j];
a[j] = a[j+1];
a[j+1] = bTemp;
}
}
}
/* print out entire array
for (int i = 0; i < a.Length; i++)
label2.Text += a[i].ToString() + " ";
}
any help would be appreciated
Thanks,
Anagm
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yes, but he did write his own code which just needed a little help with and the logic was correct.
Bob