Quick question, let''s say I want to grab all the characters in a file (reguardless of whether they''re whitespace/character) and stuff them into another file, in exactly the same format as in their original file, how could I do this using File Streams (C++)?
I think there a couple ways. If your programming it for windows, I think there are API functions you can use (I''m not sure what they are, I''m still learning the API). If not, there are standard C++ functions that you can use, I think its something like fin << and fout >>.
You figure out a way to use the DOS copy command.
But seriously, I''d say check the file I/O tutorials on both NeXe and my site (http://www20.brinkster.com/draqza) and then all you''d have to do would be read one file into a temporary buffer, then stick it back out. I don''t know if just using << and >> would work quite right, though.
--
WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);
Unable to register Reality...what''s wrong?
---------
Dan Upton
Lead Designer
WolfHeart Software

--
WNDCLASSEX Reality;
...
...
Reality.lpfnWndProc=ComputerGames;
...
...
RegisterClassEx(&Reality);
Unable to register Reality...what''s wrong?
---------
Dan Upton
Lead Designer
WolfHeart Software
WNDCLASSEX Reality;......Reality.lpfnWndProc=ComputerGames;......RegisterClassEx(&Reality);Unable to register Reality...what's wrong?---------Dan Uptonhttp://0to1.orghttp://www20.brinkster.com/draqza
#include <fstream>int main(){ ofstream outFile("out.txt"); ifstream inFile("in.txt"); outFile << inFile.rdbuf();}
(There''s a chance this might mangle binary files if done in text mode. If so, just be sure to open them both in binary mode.)
August 07, 2001 07:43 AM
|
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement