I am trying to load this correct_value file into a struct and then insert into a map. The correct_value file has uint_64 numbers, uint_8 numbers printed as text. See the CorrValueEntry struct that I provided. I narrow down to the problem that I am not getting the correct value from file>>a, I printed out a after each time file>>a is called, it's outputing 0. 
Here is the struct for the map
struct CorrValueEntry
{
uint64_t seqnum;
uint64_t actual_val;
uint64_t pc;
uint8_t piece;
uint8_t insn;
uint64_t dst;
uint64_t src1;
uint64_t src2;
uint64_t src3;
public: 
CorrValueEntry(): seqnum(0),actual_val(0),pc(0),insn(8),piece(0),src1(0),src2(0),src3(0),dst(0) {}
};
Here is the code that I try to read the correct_value file
 std::fstream file("correct_value");
 uint64_t a;
   if(file.is_open()) {
    while (file >> a)
        {
         CorrValueEntry temp; 
         uint64_t temp_value = a;
         //load seq_no
         file >> a;
         temp.seqnum = a;
         //load actual value
         file >> a;
         temp.actual_val = a;
         //load pc 
         file >> a;
         temp.pc = a;
         //load piece
         file >> a;
         temp.piece = a;
         //load instruction type
         file >> a;
         temp.insn = a;
         //load dst
         file >> a;
         temp.dst = a;
         //load src1
         file >> a;
         temp.src1 = a;
         //load src2
         file >> a;
         temp.src2 = a;
         //load src3
         file >> a;
         temp.src3 = a;
         CVT.insert(std::pair<uint64_t,CorrValueEntry>(temp_value,temp));
       }
         file.close();
   }
   else printf("file not opened\n"); 
Here is the line to declear the map
std::map<uint64_t,CorrValueEntry> CVT;
Here is a sample of the correct value file, note that the first number is the key, and it equals to seqnum; 0x51b49c or such is printed as 0x%lx when I recorded those values.
0 0 0 0x51b49c 0 0 12 9 11 3735928559
2 2 4814308436412893359 0x51b4a4 0 0 9 9 11 3735928559
4 4 640 0x51b4ac 0 1 9 8 3735928559 3735928559
5 5 65535 0x51b4b0 0 0 10 3735928559 3735928559 3735928559
6 6 66175 0x51b4b4 0 0 9 9 10 3735928559
8 8 40499520 0x51b4bc 0 1 22 22 3735928559 3735928559
10 10 0 0x51b424 0 0 9 22 3735928559 3735928559
 
    