Reading TXT Lines into Character
<p>I'm completely out of ideas right now. Basically, I want to read parts of a line in a text file, but this code is not working, and I have no idea why:</p>

<pre><code>        char temp_char  = '\0';
        char _char = '\0';
        while(1)
        {
            _places.get(temp_char);
            if(temp_char == '\t')
                break;

            _char += temp_char;

            cout &lt;&lt; _char;
        }
</code></pre>

<p>Basically, it's supposed to read from the start of the file until it comes into contact with a tab character. Unfortunately, it never stops, and _char comes out as a ton of random characters that make no sense.</p>

<p>I've looked over the TXT file, and it's the correct encoding and all, and the tab is a normal tab character in the file, but for whatever reason I can't read it from the stream using either get or >>.</p>

<p>I've been experimenting for an hour now, looked over numerous websites for help, and I've gotten nowhere... all this is doing is stressing me out...</p>

<p>Edit: I can also provide the rest of the program code if this isn't the problem, but it should be. :/</p>

<p>Here is where the file is opened:</p>

<pre><code>                ifstream _places;
                _places.open("ECC.txt");
                if (_places.fail())
                {
                    cout &lt;&lt; "Could not load text file, please make sure ECC.txt is in the same folder.";
                    _getch();
                    exit(1);
                }
</code></pre>
