Link to home
Start Free TrialLog in
Avatar of anagm
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
SOLUTION
Avatar of sk1nn4
sk1nn4

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I could swear that this looks like a homework assignment.

Bob
Yes, but he did write his own code which just needed a little help with and the logic was correct.