LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to modify a file? (https://www.linuxquestions.org/questions/programming-9/how-to-modify-a-file-350774/)

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?

Thanks.

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

Code:

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

I want OUPUT to be argv[1]

Thanks

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.