title: printf - "unexpected" output with a pointer
body: <p>I have got a challange from a friend of mine.<br>
  as part of this challange I wrote a function to get a <code>int</code> from a <code>String</code>, the function gets an array of <code>chars</code> and a pointer to a number, an index. <br></p>
  
  <p>To check if this function works I ran it with 2 numbers and watched the output. <br>
  In my <code>main</code> I printed 4 values:</p>
  
  <pre><code>int t = 0;
  printf("%d -&gt; %d, %d -&gt; %d\n", t, getNumber("99", &amp;t), t, getNumber("as48", &amp;t));
  </code></pre>
  
  <p>As it should be, I should have got: <code>0 -&gt; 99, 2 -&gt; 48</code>. <br>
  The output was: <code>2 -&gt; 99, 0 -&gt; 0</code>. <br></p>
  
  <p>After few tests I saw that it prints <code>t</code> as it is after the function is over and that it does the last function call first.<br>
  I understood that it makes sense: in <code>Assembly</code>, the last argument is being pushed to the stack first so when it is poped, the arguments would be in the right order.<br></p>
  
  <p>My questions are: <br>
  Can I print it in a "normal" way so it will look as it "should"? How? <br></p>