title: creating a process and killing it
body: <p>I'm working on an assignment that requires me to create a child process then wait for 300 seconds and kill that process, while the parent process should be killed 200 seconds after creating the child process.  I'm doing this in C++ in Ubuntu using the Clang++ compiler.  I'm very new to C++ and have been using Java for a while.  What I have now is probably more like psuedocode than anything else, I really doubt it works. When I compile it gives me errors regarding my kill() calls, I've tried things like *this.kill() or this.kill() and neither have worked. How do use the kill command?  Also, does this code look like it will do what I want?  I'm afraid it is not even close.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;unistd.h&gt;
  using namespace std;
  
  class process{
  
  public:
      process(){
          main();
      }
  
  
      void main(){
          process *parent = new process();
          int pid;
          pid=fork();
          if (pid == 0)
          {   
              sleep(200);
              kill();
          }
          else
          {
              sleep(100);
              kill();
          }
      }   
  };
  </code></pre>