LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-07-2005, 03:59 AM   #1
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
How to modify a file?


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

Thanks.
 
Old 08-07-2005, 04:06 AM   #2
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
What's "ifstream" and "ofstream"? Are they programs you want to write?
 
Old 08-07-2005, 04:12 AM   #3
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
Code:
int main (int argc, char *argv[]) {
    ifstream in(argv[1]);
    ofstream out("OUTPUT");
I want OUPUT to be argv[1]

Thanks
 
Old 08-07-2005, 04:24 AM   #4
kjordan
Member
 
Registered: Jul 2004
Distribution: LFS, I felt the itch and scratched it
Posts: 227

Rep: Reputation: 31
Why not just do an fstream? It allows you to do both input and output on a file.
 
Old 08-08-2005, 09:08 AM   #5
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
Thanks, kjordan.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
modify /etc/network file 08260068 Linux - Newbie 1 03-11-2005 04:47 PM
How to modify the XFree file. |mS|Neo Linux - Newbie 7 06-23-2003 09:16 PM
modify file access & modify timestamps i2itstud Linux - General 1 05-20-2003 03:34 AM
how to modify .bashrc file amadan_in Linux - Newbie 1 01-01-2003 03:55 AM
want to modify xf86config file gonus Linux - Hardware 1 11-07-2002 10:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration