title: C - Storing main() arguments in an array
body: <p>I am creating a multithreaded program utilizing bankers algorithm, have all of it hard coded and compiled, but I am having a problem filling the initial <code>available</code> array from user input</p>
  
  <pre><code>#DEFINE NUMBER_OF_RESOURCES 3
  
  int available[NUMER_OF_RESOURCES];       //available will be length of argc i.i number of total resoruces
  
  int main(int argc, char *argv[]) 
  {
  
  printf("AVAILABLE RESOURCE: \n [");
  //Populate Available Resource Array
  for (i = 1; i &lt; argc; i++)
  {
      available[i-1] = argv[i];
      printf("%d ", available[i]);
  }
  printf("] \n\n");
  }
  </code></pre>
  
  <p>When executing with:
  <code>./a.out 10 7 5</code></p>
  
  <p>It prints:</p>
  
  <pre><code>[1604031496 1604031499 1604031501 ] 
  </code></pre>