title: dynamic memory allocation and dynamic array
body: <p>I need to write a program, that will ask a user to enter a number of how many ints they would like to enter.. so the output would look like</p>
  
  <p>Enter number of Ints (must be greater then 1)</p>
  
  <p>and they would input a number between 2 - infinity (if they really wanted to go that far)</p>
  
  <p>at that point i would scanf that number and set it to a variable</p>
  
  <p>now with that number, i want to run a for loop to ask them to begin entering their Ints</p>
  
  <pre><code>for (count = 0; count &lt; numofInts; count++)
  {
      printf("    Enter an integer: ");
     scanf("%d", &amp;Number);
  }
  </code></pre>
  
  <p>the problem im having is that i need to make sure that it records every number that they enter, so i need to have those values stored to an array, but the number of elements of the array must be dynamic so that it can change depending on the numofInts,  I'm supposed to use Malloc() to create a dynamic memory allocated space, and i understand that it creates a variable with a memory space of what ever i set the malloc to, but i don't know how to store a series a variables to that space, and then call them back as i need them.</p>
  
  <p>The end result of the program is supposed to take a number like 123456789, and cycle through the number storing the intergers as the "largest" int, and then spit out which int is the largest, so like x = 1234567890, x % 10, x = 0, largest = x, x / 10, x % 10, x = 9, if x > largest, largest = x, and just loop that till it cycles through the whole number,  and store that number at the very end.  I have that part down, but because i have to take a series of numbers and run this loop for all of those numbers, i need to be able to store and recall those values and place them in the loop to be able to store the largest digits of those numbers</p>
  
  <p>any help with this problem would be greatly appreciated, i just have not been able to figure out how to use malloc or to create a dynamic array and most of the tutorials ive read online or watched from youtube are about C++ and i need to do this with just C...</p>
  
  <p><a href="http://pastebin.com/PZyvEQ4J" rel="nofollow">http://pastebin.com/PZyvEQ4J</a></p>
  
  <p>what i have so far</p>