I'm trying to figure out how to simplify an incredibly long line of code. I'm trying to check whether one number of an array element is larger than the previous one. My raw code for this line is:
As you can see, it's very long, not very efficient, and hard to read. I'm trying to get this on maybe 1-2 lines, if possible. Any help would be much appreciated. Thanks in advanced for your help.
The thing is though, I don't know how to make a loop that would increase the elements of an Array, then compare them. The closest I've come is:
1 2 3
{
for (int x=0; x < length; x ++)
}
And then I'm pretty much stuck. I don't know how to increase the increments of an array, then put them into a loop. I've tried everything from anArray[x+1] to anArray[x]+1 to anArray[++] and I just can't figure it out.
I appreciate your help Long, but it's not doing what I want it to. I'm still messing around with things in my code. I am very happy that you showed me that myArray[x+1] is indeed a valid operation in C++. What I'm getting from this code is:
When the parameters of i are less than 9, increase the base parameters until it reaches 8. Then compare each increment of the element to the one next in line?