title: Copying Value of a pointer to a variable, Pointer is passed as an argument C Program
body: <pre><code>int NJOBS=0;
  
  struct Jobs{
      char *jname;
      int btime;
      int priority;
      int order;
  }Job[10];
  
  int cmd_run(int nargs, char **args) {    
      NJOBS++;
  
      Job[NJOBS].order=NJOBS;
  
      int bt = atoi(args[2]);    
      int pri = atoi(args[3]);
  
      Job[NJOBS].btime=bt;    
      Job[NJOBS].priority=pri;    
      Job[NJOBS].jname=args[1];    
  }
  </code></pre>
  
  <p>I have a structure to carry job Details. A dispatcher function is passing arguments(args) from commandline to cmd_run function.
  args in cmd_run will have something like this "Jobname 10 1".
  I need to copy Jobname to Job[NJOBS].jname, while I am able to copy integer variables but string variables are not being copied. I also tried using a local cont char array and tried copying from argument to local variable it still does not work.
  Please provide suggestions.
  Help is much appreciated.</p>
  
  <p>Thank you much! </p>