Hi I am having trouble with a program that I am currently working on. The program is going to read in the names and numbers from a text file and store the numbers in an integer vector and the names in a string vector. I am new to c++ and am having difficulty getting the data to load into the separate vectors.
This is part of the input file:
I was able to figure this step out so I am now working on the next step. I need to check to see if the input data is sorted by name, number, or is unsorted. I have written some pseudcode to help in the process of creating the function.
1 2 3 4 5 6 7
isSorted( items[0..N-1] )
{
for( i = 0; i < N-1; ++i )
if( items[i] > items[i+1] )
returnfalsereturntrue
}