I need to create a function that uses a loop. This function will open a text file and then be able to skip a variable number of leading random numbers. The program should be able to handle any number of leading random integers.
Example, if an open file reads this in its first line:
100 120 92 82 38 49 102
and the variable is SKIP_NUMBERassigned 3 number, which will be captured by function 82.
The function should continue to capture integers every SKIP_NUMBERuntil it reaches the end of the file. These integers taken from the txt file are then placed in another text file.
Please help, I really lost how to create this loop !: D
Here is my function so far ...
int skipVariable (int SKIP_NUMBER)
{
return 0;
}
These are my program variables:
ifstream fin;
string IN_FILE_NAME, OUT_FILE_NAME;
int SKIP_NUMBER;