title: Passing variables over to another file
body: <p>The values change when being used in ellipsefunctions.c, which I don't understand. The values aren't static either, and change depending on A, B, C, while h and k are the same. Can soemeone tell me whats going on?</p>
  
  <p>a.out was compiled using 'gcc ellipsemain.c ellipsefunctions.c'</p>
  
  <p>Couldn't post the screenshot because I don't yet have enough rep, but here's a link to it</p>
  
  <p>i.stack.imgur.com/Ag6Vg.png (if screenshots aren't your thing look below)</p>
  
  <p>ellipsemain.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char *argv[])
  {
      if(6 &gt; argc){
          printf("Too few arguments, please follow the format: &lt;executable&gt; &lt;A&gt; &lt;B&gt; &lt;C&gt; &lt;h&gt; &lt;k&gt;\n");
          exit(0);
      }
      if(6 &lt; argc){
          printf("Too many arguments, the program will still attempt to run using the first 5 inputs\n");
      }
  
      float A = atof(argv[1]);
      float B = atof(argv[2]);
      float C = atof(argv[3]);
      int h = atoi(argv[4]);
      int k = atoi(argv[5]);
  
      printf("%f\n%f\n%f\n%d\n%d\n\n\n", A, B, C, h, k);
      usingany(A, B, C, h, k);
      printf("\n\n%f\n%f\n%f\n%d\n%d\n", A, B, C, h, k);
      return 0;
  }
  </code></pre>
  
  <p>ellipsefunctions.c:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void usingany(float A, float B, float C, int h, int k);
  
  
  void usingany(float A, float B, float C, int h, int k)
  {
      printf("%f\n%f\n%f\n%d\n%d\n", A, B, C, h, k);
      return;
  }
  </code></pre>
  
  <p>console:</p>
  
  <p>y:~/ENEE150/ENEE150HW1/Problem1: a.out 1 1 1 1 1
  1.000000
  1.000000
  1.000000
  1
  1</p>
  
  <p>1.875000
  0.000000
  1.875000
  0
  1072693248</p>
  
  <p>1.000000
  1.000000
  1.000000
  1
  1</p>