When you process an employee, you can just use the post-increment count++ or pre-increment ++count, however you decide to work on your code. You don't need a separate variable for count at this point, since count will be the sum. After the while loop, you can just std::cout << "total count is" << count<< std::endl;