Garmaine Staff asked 1 year ago

So I have some decoded text which I have to write as binary in a new file. I came up with this code but it writes it as a decoded text instead of binary

#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <cctype>
#include <locale> 
#include <vector>
#include <iterator>
#include <iomanip>
using namespace std;

int main() {
    ofstream outputFile;
    outputfile.open("binary.dat");  
    ifstream file("binary.dat",  ios::binary); 
    outputfile <<"68656C6C6F20776F726C64";
    return 0;
}

Thank you for any help!