Hi guys
In a win XP command prompt I can do the following:
copy file1+file2 file3
del file1
del file2
Is there a way that I can do this in c++?
Cheers
Printable View
Hi guys
In a win XP command prompt I can do the following:
copy file1+file2 file3
del file1
del file2
Is there a way that I can do this in c++?
Cheers
You can also create a C-style string and pass it into system ().Code:#include <cstdlib>
...
system ( "del file1" );
Doing that you can get input from a user and format it all into a string and use it as an argument. That way, you can change what needs to be deleted or copied ect...
minor nit: should be
std::system ("del file1");
Are you sure?Quote:
Originally Posted by moi
I dont think the standard "C" headers are in the std namespace.
They are supposed to be, but they aren't for some compilers (like MSVC++ 6.0).
Ah ok, that explains it. So it varies from compiler to compiler.
I wish compilers would all just get along :p
the standard c headers, ie, <stdlib.h> are outside of a namespace. the C++ "new" standard c headers, ie, <cstdlib> should be in std::Quote:
Originally Posted by Vicious
Thanks guys. I'll give this a go.