I have a program that copies several files from a certain directory to another dir...but I realized today that a friend of mine that uses my program has a completely different dir structure than mine. right now the program just uses system("copy") to copy the files, and i have now realized that if i want my friend to be able to use this program, i am going to have to modify my prog a bit.
i'm going to change things so that the user can choose what directory to copy the files to (of course using a cin, since this is a console app). however... as far as i know, you can't pass variables to system calls... if i'm wrong on this let me know.
Now i just need to know how to code copying+pasting files. i know it's something to do with fstreams, but i don't know exactly what. there is a function in my program that i made that checks the existence of the files to copy, which just scans for the filesize and returns positive if the filesize is greater than 0. I know the key to copying files lies in the same method as i used to check their existence... but as i mentioned, i am at a loss as to how to do this. Any help would be greatly appreciated!!
Have a look at the post from Dual-Catfish on the thread below, I haven't tested this, but it looks right to me.
Thanks... i'm getting to work on a fix for my program right now.