Hey everyone... can anyone help me out with a bit of a conversion problem? I cant seem to find a way to successfully do this, so hopefully someone here can point me in the right direction.

Basically, I have a file that has a list of binary numbers, like this:

01001001
00100000
01110011
01101000
01101111
01110000

And I have this code so far:

Code:
#include <iostream>
#include <string.h>
#include <iomanip>
#include <fstream>
using namespace std;

int main() {

        string binstring;
        ifstream binList;
        int bytecount = 0;
        binList.open("binary.txt");
        if (binList) {
                cout<<"File opened successfully."<<endl;
        }
        if (!binList) {
                cerr<<"Unable to open the file."<<endl;
                exit(1);
        }
//start reading data and act on it
        binList>>binstring;
        bytecount++;
        cout<<bytecount<<" "<<binstring<<endl;
        while (binList) {
                binList>>binstring;
                bytecount++;
                cout<<bytecount<<" "<<binstring<<endl;
                cout<<endl;
        }
        binList.close();
        cout<<"Finished"<<endl;
return 0;
}
Now, of course, right now this little bit of code does nothing useful. It just opens the file, reads in a line, and prints it out.

What I want to accomplish is to take each line (in the string form 01001010) and convert that to its ascii character.

So if the program reads this: 01000001 it outputs ascii char 65, or 'a'.

any suggestions? the hard part is the conversion of the string binstring to an integer or hex that == the actual binary value of 01000001 and not the value of the char string 01000001 (if that makes any sense).

Any suggestions?

Thanks
Jeff