title: How to pass command line arguments to C program using execlp
body: <p>I am trying to use execlp in a c program to run another c program. The exec function does call the program, but it does not pass the integer arguments correctly. My exec call is: </p>
  
  <pre><code>int exec_arg_1, exec_arg_2;
  
  if(pid == 0){
      printf("Repeat Number: %d, Process Number: %d\n", exec_arg_1, exec_arg_2);
      execlp( "/home/drlight/Desktop/asp/Assignment_3/philosopher.o", 
         "philosopher.o", &amp;exec_arg_1, &amp;exec_arg_2, NULL );
             printf("Exec didn't work...\n");
      }
  </code></pre>
  
  <p>I assign values to the exec_arg ints, and print them right before to make sure they're correct, but the philosopher.o function just reads 0's from the location. If I run philosopher.o from the command line, it reads the arguments normally. </p>