Hello,
I'm building a cp like program and here is the code of the file copy, i'm in the beginning, i'm going to put the error messages when i be in some good state of the program:
#include <iostream>
#include <fstream>
using namespace std;
int main( int argc, char* argv[] )
{
char* inputFile;
char* outputFile;
inputFile = argv[ 1 ];
outputFile = argv[ 2 ];
ofstream(outputFile) << ifstream(inputFile).rdbuf();
return 0;
}
But how i can do a code that the program finds if the file is in the directory that the terminal is and copy it to the output location, remember that i'm using Linux.
Thanks,
Nathan Paulino Campos