Creating a C++ program to skip integers in a text file?
<p>This is my first time on this site and I appreciate any help on my problem.  I am in my first C++ class and I admit I am not an expert at computer programing, so if you could make your answers as dumbed down an specific as possible it would help out my beginner status immensely.</p>

<p>I will be creating a program that decodes encrypted text files. The files are comprised of several sets of ten integers. Depending on the file, there are a number of random values in the file prior to the number for each character. For example, in a file there might be three random numbers, than a number representing a character, then three more random numbers, than the next number representing a character, and so on.</p>

<p>The program will needs to prompt the user for the input file, then the output file, and the number of random numbers to skip before each legitimate integer/character. Note that my program needs to be able to handle any number of leading random numbers. Meaning it might have three random numbers before a legitimate one, or thirty random numbers before.</p>

<p>Here is my whole program so far.  The function I need to create is called skipVariable, if someone could please help me create this function it would be oh so helpful i have been staring at it for hours and I just can't imagine how to complete this task.</p>

<hr>

<pre><code>//Header Files
#include &lt;iostream&gt; 
#include &lt;fstream&gt; 

using namespace std;

// Global Constants

const char SPACE = ' ';

//Function Prototypes


/*
name: programTitle
input: none
output: void (string)
dependencies: none
process: output string
*/
void programTitle();

/*
name: promptUser
input: none
output: void file name and int skip number
dependencies: none
process: output string name and skip number int
*/
void promptUser ( string &amp;IN_FILE_NAME, string &amp;OUT_FILE_NAME, int &amp;SKIP_NUMBER);

/*
name: openInputFile
input: ifstream &amp;inf, &amp;fileName (string)
output: good bad file (bool)
dependencies: none
process: test if file can be opened/ does it exist
*/
bool openInputFile( ifstream &amp;inf, const string &amp;fileName );

/*
name: skipVariable
input: skip number(integer)
output: calculated result (int)
dependencies: none
process: ( skip variable in file and give exstracted number)
*/
int skipVariable (int SKIP_NUMBER);

// Main function/program
int main ()
{
// initalize function/variables

ifstream fin;
string IN_FILE_NAME, OUT_FILE_NAME;
int SKIP_NUMBER;

//Print Program Title
//Function Name: programTitle
programTitle();

//Prompt user for input file name and skip number
//Function Name: promptUser
promptUser ( IN_FILE_NAME, OUT_FILE_NAME, SKIP_NUMBER);

//Check it file is usable and openable
//Function Name: openInputFile
openInputFile( fin, IN_FILE_NAME);

//Skip variable number
//Function Name: skipVariable
skipVariable ( SKIP_NUMBER);




//Close input file
fin.close();

// make spaces before program end   
cout &lt;&lt; endl &lt;&lt; endl;

// End program
system( "pause" );

return 0;
 }

// Supporting function implementation
//

 //Display Program Title
void programTitle()
 {

  // output prompt string
cout &lt;&lt; "     DECODER PROGRAM" &lt;&lt; endl;
cout &lt;&lt; "     ===============";
cout &lt;&lt; endl &lt;&lt; endl;

 // void function - no return
}


 //Prompt user for Input
void promptUser ( string &amp;IN_FILE_NAME, string &amp;OUT_FILE_NAME, int &amp;SKIP_NUMBER)
{
//prompt for an input file name
cout &lt;&lt; "Enter input file name: " ;
        cin &gt;&gt; IN_FILE_NAME;
cout &lt;&lt; endl;

//Prompt for an output file name
cout &lt;&lt; "Enter output file name: " ;
        cin &gt;&gt; OUT_FILE_NAME;
cout &lt;&lt; endl;  

//Prompt for number of items to skip
cout &lt;&lt; "Enter number of items to skip: " ;
        cin &gt;&gt; SKIP_NUMBER;
cout &lt;&lt; endl &lt;&lt; endl &lt;&lt; endl;

// Print process data indication
cout &lt;&lt; "Processing Data . . ." &lt;&lt; endl &lt;&lt; endl;

//void function no return
}


//Function opens file and checks if file exists
bool openInputFile( ifstream &amp;inf, const string &amp;fileName )
{
// clear and open input file
inf.clear();
inf.open( fileName.c_str() );

// return input file condition
return inf.good();

}


//Functio skips variables and returns needed integer
int skipVariable (int SKIP_NUMBER)

//Is the file good/usable
 {

//start loop skip valued variable

       //get number representing character

       //output as file character

// return values
return 0; //temporary return
}
</code></pre>
