Hello,
I've been struggling with a problem for a while now. I'm trying to print out information which is contained in a binary file.
This what I get when I open it in notepad.
Marjorie Gestring D201 ð¿ ð¿ ð¿ ð¿ ð¿ Patricia McCormick D202 ð¿ ð¿ ð¿ ð¿ ð¿ Anna Andersson ick D203 ð¿ ð¿ ð¿ ð¿ ð¿ Fanny Duracks ick D204 ð¿ ð¿ ð¿ ð¿ ð¿ Ulrika Knape ick D205 ð¿ ð¿ ð¿ ð¿ ð¿ Greta Johanson ick D206 ð¿ ð¿ ð¿ ð¿ ð¿ Anna Lindberg ick D207 ð¿ ð¿ ð¿ ð¿ ð¿ Gunilla Rosenhoff D208 ð¿ ð¿ ð¿ ð¿ ð¿ Kathy Peiss nhoff D209 ð¿ ð¿ ð¿ ð¿ ð¿ Birgitta Conradson D210 ð¿ ð¿ ð¿ ð¿ ð¿ Lisa Regnell adson D211 ð¿ ð¿ ð¿ ð¿ ð¿ Leena Laine adson D212 ð¿ ð¿ ð¿ ð¿ ð¿ Paulina Suokas son D213 ð¿ ð¿ ð¿ ð¿ ð¿ Gerda Meyerson son D214 ð¿ ð¿ ð¿ ð¿ ð¿
I'm not trying to write anything complex right now. I just want to retrieve all the names and D-numbers for now.
What I wonder shouldn't this code print out every character it finds? If I want to get all the names and print it out nicely is it necessary to write a struct to contain the information?
char c;
in.read( (char*)&c, sizeof(char) );
while(!in.eof()) {
in.read( (char*)&c, sizeof(char) );
cout << c << endl;
}