Can anyone tell me why I'm not getting ones and zeros in my created text file ?Code:#include <windows.h> #include <iostream.h> #include <fstream.h> #include <string> ofstream outfile; ifstream infile; char name[256]; char contents[200]; int main() { cout << "Name your file. Press ENTER when finished." << endl << ">> "; cin.getline(name, 256, '\n'); cout << "\n\nNow type the contents. Press * and ENTER when finished.\n>> "; cin.getline(contents, 200, '*'); outfile.open(name); outfile << contents, ios::binary; outfile << "\n\n\nDid it work ? Hell no, as usual..."; outfile << "\n\nCan you read this ?", ios::binary; return 0; }
Thanks