C++ Class won't execute function : <p>I want to write a simple backup program. Its not finished yet, but i've encountered a problem: My class responsible for setting the right path wont execute the worker which will copy the file. I don't know why and yes - i already looked up on any helping site i know. Here is my filecopy h code:</p>

<pre><code>#ifndef __FILECOPY_H_INCLUDED__
#define __FILECOPY_H_INCLUDED__

#include&lt;iostream&gt;
#include&lt;fstream&gt;
#include&lt;ctime&gt;

class filecopy
{
     std::string dest_path;
     std::string src_path;
public:
     filecopy(std::string, std::string);
 void filecopy_worker()
 {
      std::cout &lt;&lt; "FILECOPY PROCESS STARTED" &lt;&lt; std::endl;
      std::ifstream source(src_path);
      std::ofstream dest(dest_path);
      dest &lt;&lt; source.rdbuf();
      source.close();
      dest.close();
 }
};

filecopy::filecopy(std::string a, std::string b)
{
     dest_path = a;
     src_path = b;
}

#endif
</code></pre>

<p>And here my main.cpp code:</p>

<pre><code>#include&lt;iostream&gt;
#include&lt;stdlib.h&gt;
#include"filecopy.h"

int main(int argc, char *argv[])
{
     if(argc != 3)
     {
          std::cout &lt;&lt; "USAGE: " &lt;&lt; argv[0] &lt;&lt; " &lt;filesource&gt;" &lt;&lt; std::endl;
          return 1;
     }
     else
     {
          filecopy target1(argv[2], argv[1]);
          std::cout &lt;&lt; "TARGET ASSIGNED" &lt;&lt; std::endl;
          std::cout &lt;&lt; "EXECUTE FILEWORKER" &lt;&lt; std::endl;
     }
     return 0;
}
</code></pre>
