I'm new to C++, and my goal is to open a file with numbers in it, and see if they are in order. I also need to check to see if they are strictly increasing, strictly decreasing, or neither.

if anybody could help me get started for checking if they are in order after opening the txt file, i would appreciate it.

pseudo-code for checking to make sure it is in increasing order:

open file for input
lastnum = read in a number
while (still stuff in file)
{
input = read in a number
if input < last num
___print input " is not in order!"
lastnum = input
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.