Is there an *easyer* way of copying a file other than opening it, copying the contents to a string and then inputing it into a file??
Is there an *easyer* way of copying a file other than opening it, copying the contents to a string and then inputing it into a file??
--== www.NuclearWasteSite.com==--
depends on the operating system you are using. Most have some sort of copy file function.
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Windows 98
--== www.NuclearWasteSite.com==--
if you are writing a windows program then you can use CopyFile() or CopyFileEx()..... look them up at msdn for code samples and information
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
ok i tryed going to msdn but i cant find any code, here's what i have so far, i know im not even close.
[code]
#include <iostream.h>
#include <windows.h>
int main()
{
char filename[50];
cout<<"Filename: ";
cin>>filename;
CopyFileEx("a:\\blah.txt", filename, NULL);
}
This gives me only 1 error: ( the short version if it is) ERROR 32: too few peramiters.
can some one take the code i just wrote and make it work PLEASE i know this is asking alot and asking some one to write ur program is wrong but for the life of me i cant figure it out.
--== www.NuclearWasteSite.com==--
You could use CopyFile instead of CopyFileEx if you don't need to use the extra parameters as it's alot simpler -
CopyFile("blah.txt","copy",1);