I am trying to read in a file containing 0's & 1's, 64 at a time to convert into a decimal. After executing my code, cout shows no values read and my console hangs.
std::cout << "Enter The Filename For Input: ";
std::cin.get (str,64); // get c-string
std::ifstream is(str); // open file
// Check file is open
if (!is) {
cerr << "Can't open input file " << str << endl;
system("PAUSE");
exit(1);
}
// in_file >> is(str);
while (!is.eof()) //do while not EoF
{
while (is.get(c)) // loop getting single chars
{
if (c == '\n') { // another check for eof
cout << "The binary values read are " << is.get(c) << endl;
decimal = 0;
// in_file >> is(str); // read in NumsIn.txt
continue; // Go back to start of while loop
} // end if
decimal *= 2;
/////////////////////////////////////////////