c++: Trouble detecting ascension of numbers in an array
<p>I'm a novice to c++ programming and currently taking a class as an introduction to programming. I am currently working on a homework project where I input 10 integers and determine whether the numbers are in ascending order or not.</p>

<p>The issue I'm having is that the program always thinks there is a ascension, no matter the input provided. I figured the problem lies in the IsInOrder() function's for loop, however I can't figure out why exactly it isn't working or how to fix it. </p>

<p>Another potential problem is how to determine ascension for all values, for instance if my code worked I think it would count [1, 2, 3, 4, 5, 1, 2, 3, 4, 5] as an ascension, even though it's not.</p>

<p>I've tried searching online and have found a few similar assignment questions, but with no answer to these problems.</p>

<p>Here's the code I have so far:</p>

<pre><code>#include &lt;iostream&gt;

using namespace std;

bool IsInOrder (int numHold[]);

//This portion takes the numeral inputs and outputs the answer
int main()

{
int numHold[10];

bool status;

cout &lt;&lt; "Welcome to the Ascension detector 5000" &lt;&lt; endl;
cout &lt;&lt; "This program will detect whether the numbers you input are in ascending   
order" &lt;&lt; endl;
cout &lt;&lt; "Isn't that neat?" &lt;&lt; endl &lt;&lt;endl;

for (int i=0; i &lt; 10;i++)
{
    cout &lt;&lt; "Please enter a number: ";
    cin &gt;&gt; numHold[i];
}
cout &lt;&lt; endl;

for(int i=0;i &lt; 10;i++)
{
    cout &lt;&lt; numHold[i] &lt;&lt; endl;
}

status = IsInOrder(numHold);

if (status == true)
{
    cout &lt;&lt; "The numbers are in ascending order" &lt;&lt; endl;
}
else
{
     cout &lt;&lt; "The numbers are not in ascending order" &lt;&lt; endl;
}



system("PAUSE");
return 0;
}

//This function determines whether the inputs are in ascending order

 bool IsInOrder (int numHold[])
{
for (int i = 0; i &lt; 10; i++)
{
        if (numHold[i] &lt; numHold [i++])
        {
            return false;
        }
        else
        {
            return true;
        }
}
}  
</code></pre>

<p>Appreciate any help in advance and sorry if the code isn't well formatted, the code wasn't copy/pasting well in to the code sample.</p>
