Help reading from file

Ok so i have a program that interprets Binary that i created into numbers, this is what it reads from the file: 11001 00100 :: 11001 00100

11001 is A, 00100 is B and :: means go to the next line. However i cannot seem to get this program to read everything then wrap the last A and B to the next line, so if the program were to execute the way i wanted it too, it would look like this:

A B
A B

But instead i get this: A

Here is the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main()
{
    ifstream file ("Binary.txt");

    string binary;
    string nextline = "::";

    file >> binary;
    file >> nextline;

    if(binary == "11001"){
    cout << "A";
    }

    if(binary == "00100"){
    cout << "B";
    }

    if(binary == nextline){
    cout << "\n";
    }

    cout << binary;

    cin.get();
    return 0;
}
Topic archived. No new replies allowed.