input string, output to a folder


Hi, ive been outputing some text files (which get written to) to the folder i compile and run main.cc from (C:\frenchcr\Main).

But i need to create and open these in a subfolder inside the Main folder.. C:\frenchcr\Main\Qs\

this is the code ive been using
1
2
3
4
5
6
7
8
9
    ofstream QFR[8];
    QFR[0].open("QFc1.txt", ios::out);
    QFR[1].open("QFc2.txt", ios::out);
    QFR[2].open("QFc3.txt", ios::out);
    QFR[3].open("QFc4.txt", ios::out);
    QFR[4].open("QFc5.txt", ios::out);
    QFR[5].open("QFc6.txt", ios::out);
    QFR[6].open("QFc7.txt", ios::out);
    QFR[7].open("QFc8.txt", ios::out);


Last edited on
So what's the problem ? Use full path in ofstream constructor.

ok, if i send a directory path into main using:

string Q_File = argv[++argi];

how do i contruct it...im thinking like this..

ofstream(Q_File , QFR[8])

any ideas?
Last edited on
Topic archived. No new replies allowed.