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
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...
What is C++?
minor nit: should be
std::system ("del file1");
hello, internet!
Are you sure?Originally Posted by moi
I dont think the standard "C" headers are in the std namespace.
What is C++?
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
What is C++?
the standard c headers, ie, <stdlib.h> are outside of a namespace. the C++ "new" standard c headers, ie, <cstdlib> should be in std::Originally Posted by Vicious
hello, internet!
Thanks guys. I'll give this a go.