# simple code question

This is a discussion on simple code question within the C Programming forums, part of the General Programming Boards category; i need to write a program to move files from one folder to another how do I "cut and paste" ...

1. ## simple code question

i need to write a program to move files from one folder to another how do I "cut and paste" in c

2. This sounds like a job for the OS. If you have to do it in C, have the OS do it with system() calls.

If you're bored, you can always read in a file, and write it out again somewhere else.

3. Or, if it's for Windows only, use MoveFile.

--
Mats

4. can someone give me a quick sample code that uses movefile, I'm not sure on the syntax

5. ... MoveFile("C:\\from\\here.txt", "C:\\to\\here.txt");

Seriously, doesn't get much easier

6. thanx a bunch

7. should the code look like this
Code:
void main()
{
BOOL movefile("C:\\stuff","C:\\stuff2");
}
sry im a real noob

8. it should be