alright guys, this should be an easy one…
I have an int array and I want to see if the the numbers in the array are in succession.
For some reason when I do this (below) my array goes from int values to ascii and gets all funky and doesn’t work. Any suggestions would be greatly appreciated. In this exampleit should return true.
int numArray[5] = {1,2,3,4,5};
for( int i = 0 ; i < 4 ; i++ )
{
if ( numArray[i] == numArray[i+1] - 1 )
{
continue;
}
else
{
return false;
}
}
return true;
I would write something like this, a little simpler to read.