write formatted stuff into file efficiently
===

I have a quite large `vector<string>` in memory, and I want to write each `string` into `./log.txt`, here is how I do it:

    ofstream ofs("./log.txt");
    for (vector<string>::const_iterator cit = vec.begin(); cit != vec.end(); cit++) {
        char buf[30];
        sprintf(buf, "%s ---@", cit->c_str());
        ofs << buf;
    }
    ofs.close();

I'm caring about disk I/O times, is it efficient? Any better I idea?