C++ Strange File Output
<p>I'm trying to read from a simple text file. Whenever I run the program it prints out the file, 
but not before printing out a bunch of garble. Any suggestions?</p>

<p>Garble:</p>

<pre><code>Φ#·  ├ï Uï∞ Φ╖   ≈╪←└≈╪YH]├ 5tδ╝
 abc    
</code></pre>

<p>Buffer.cc</p>

<pre><code>//-----------------------------------------------------
//  TextInputBuffer  - Constructor for TextInputBuffer.
//-----------------------------------------------------
TextInputBuffer::TextInputBuffer(char *InputFileName)
{
    //--Open file. Abort if failed.
    InputFile.open(InputFileName, std::ios::in);
    if (!InputFile.good()) exit(1);
}

//-----------------------------------------------------
//  GetNextLine      - Get next line from input file.
//
//  Return: The first character of the next line.
//-----------------------------------------------------
char TextInputBuffer::GetNextLine()
{
    //--Get next line from input file.
if (InputFile.eof()) *ptrChar = eofChar;
else
{
    InputFile.getline(Text, MaxInputBufferSize);
    ptrChar = Text;
}

return *ptrChar;
}

//-----------------------------------------------------
//  GetNextChar      - Get next character from the text
//                     buffer.
//
//  Return: The next character in the text buffer.
//-----------------------------------------------------
char TextInputBuffer::GetNextChar()
{
    char ch;

    if      (*ptrChar == eofChar) ch = eofChar;
    else if (*ptrChar == eolChar) ch = GetNextLine();
    else
    {
        ++ptrChar;
        ch = *ptrChar;
    }

    return ch;
}
</code></pre>

<p>List.cc</p>

<pre><code>TextInputBuffer InputBuffer(argv[1]);
char ch;

do {
    ch = InputBuffer.GetNextChar();

    if (ch == eolChar)
        std::cout &lt;&lt; std::endl;

    std::cout &lt;&lt; ch;
} while (ch != eofChar);
</code></pre>
