outputting pdf files using C++ file I/O
11:38 07 Jul 2017

I was trying to output a string to a file using File I/O of C++, but I decided to change the extension of the output file to .pdf, .docx and so on.

None of them seem to open up.

So are there any more internal translations required in order to make that file a proper(file which opens) pdf or docx??

void convert(char *file){

    ifstream in(file);
    ofstream out("out.pdf",ios::out);

    char str;

    while(in && out){
        in.get(str);
        out.put(str);
    }

    in.close();
    out.close();
    cout<<"Done!!!";
}
c++ file pdf