GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-May-2004, 02:24
kilgortrout kilgortrout is offline
New Member
 
Join Date: May 2004
Posts: 12
kilgortrout is on a distinguished road

writing to 6 different files


can someone tell me how to write to 6 different files in the same program

thanks kilgor
  #2  
Old 20-May-2004, 04:19
Max Payne's Avatar
Max Payne Max Payne is offline
Regular Member
 
Join Date: Apr 2004
Location: 3° 08 North 101° 42 East
Posts: 332
Max Payne is a jewel in the roughMax Payne is a jewel in the roughMax Payne is a jewel in the rough
Hi,

I don't see why you have to post in two different forum the same question The other forum is for question on MFC or VC++ question, if it is related to c/c++ generally, you could post here in this forum.

6 different files in the same program?? look, this would do that:

CPP / C++ / C Code:

ifstream file1;
file1.open(....);
ifstream file2;
file2.open(....);
ifstream file3;
file3.open(....);
ifstream file4;
file4.open(....);
ifstream file5;
file5.open(....);
ifstream file6;
file6.open(....);

file1.close();
file2.close();
file3.close();
file4.close();
file5.close();
file6.close();

should I put the same answer in the other thread also??
I can get one more extra post.
__________________
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." Linus Torvalds
Last edited by Max Payne : 20-May-2004 at 04:50.
  #3  
Old 20-May-2004, 07:52
machinated machinated is offline
Regular Member
 
Join Date: Mar 2004
Location: victoria, canada
Posts: 324
machinated has a spectacular aura aboutmachinated has a spectacular aura about
you don't have to use file.open() function. you can just use the constructor:

ifstream file("blah.txt");
__________________
spasms!!!
  #4  
Old 20-May-2004, 16:58
kilgortrout kilgortrout is offline
New Member
 
Join Date: May 2004
Posts: 12
kilgortrout is on a distinguished road

the 6 files


Quote:
Originally Posted by Max Payne
Hi,

I don't see why you have to post in two different forum the same question The other forum is for question on MFC or VC++ question, if it is related to c/c++ generally, you could post here in this forum.

6 different files in the same program?? look, this would do that:

CPP / C++ / C Code:

ifstream file1;
file1.open(....);
ifstream file2;
file2.open(....);
ifstream file3;
file3.open(....);
ifstream file4;
file4.open(....);
ifstream file5;
file5.open(....);
ifstream file6;
file6.open(....);

file1.close();
file2.close();
file3.close();
file4.close();
file5.close();
file6.close();

should I put the same answer in the other thread also??
I can get one more extra post.

i posted in the other forum by mistake anyway what i really need to know is how to write into each file from a struct any thoughts?

thanks kilgor
  #5  
Old 20-May-2004, 18:09
aaroncohn's Avatar
aaroncohn aaroncohn is offline
Regular Member
 
Join Date: Feb 2004
Location: Bay Area, CA.
Posts: 564
aaroncohn is a jewel in the roughaaroncohn is a jewel in the roughaaroncohn is a jewel in the rough
Quote:
Originally Posted by kilgortrout
i posted in the other forum by mistake anyway what i really need to know is how to write into each file from a struct any thoughts?

thanks kilgor
http://www.gidforums.com/t-2062.html
__________________
-Aaron
  #6  
Old 20-May-2004, 18:30
WaltP's Avatar
WaltP WaltP is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Midwest US
Posts: 3,258
WaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to allWaltP is a name known to all
Quote:
Originally Posted by kilgortrout
anyway what i really need to know is how to write into each file from a struct any thoughts?

Do you know how to write ti one file? Do that 5 more times.
__________________

Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough.
-- Pearl Williams
 
 

Recent GIDBlogPython ebook by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't view pages from another machine on the Intranet aevans Apache Web Server Forum 9 14-May-2004 03:26
uploading files into server prinzekay MySQL / PHP Forum 5 16-Mar-2004 01:00
gxx linker accepts only 7 object files danielxs66 C++ Forum 1 12-Dec-2003 10:27
How to create batch files without DOS box? rhino1616 Web Design Forum 3 18-Aug-2003 11:00

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 00:58.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.