title: How read two lines numbers from input to 2 arrays, C language? Without knowing the amount of number? in C
body: <p>For example, input is:</p>
  
  <pre><code>12 23 32 41 45
  22 11 43
  </code></pre>
  
  <p>lines end with <code>'\n'</code>,</p>
  
  <p>I want save nums to <code>a[]</code> and <code>b[]</code>;</p>
  
  <pre><code>a[] = {12, 23, 32, 41, 45}
  b[] = {22, 11, 43}
  </code></pre>
  
  <p>The point is I DON'T KNOW how many number of each line.</p>
  
  <p>If I know line1 <code>n</code> numbers and line2 <code>m</code> numbers, I will use "for loop", and no question.</p>
  
  <p>Just like,</p>
  
  <pre><code>for(int i = 0; i &lt; n; i++) scanf("%d", a+i);
  for(int i = 0; i &lt; m; i++) scanf("%d", b+i);
  </code></pre>
  
  <p>But, I DO NOT know n and m, How to do, guys?</p>