-   Programming (
-   -   How to modify a file? (

kornerr 08-07-2005 03:59 AM

How to modify a file?
I want to ifstream ("file") and then ofstream ("file).
How to do it?


eddiebaby1023 08-07-2005 04:06 AM

What's "ifstream" and "ofstream"? Are they programs you want to write?

kornerr 08-07-2005 04:12 AM


int main (int argc, char *argv[]) {
    ifstream in(argv[1]);
    ofstream out("OUTPUT");

I want OUPUT to be argv[1]


kjordan 08-07-2005 04:24 AM

Why not just do an fstream? It allows you to do both input and output on a file.

kornerr 08-08-2005 09:08 AM

Thanks, kjordan.

All times are GMT -5. The time now is 09:43 PM.