user27201: I have a very simple sketch, something like this: 
int aFour = 4; 
softwareSerial.print(4,BIN); 
softwareSerial.print(aFour,BIN);

Which gives the following output: 
1001
0011

Why don't they print both as 0100? 
EDIT: the output was in one line : 10010011, I falsely asumed the output should be split into twice 4 bits. 

user4143: 
print never prints leading zeroes (how many should it print anyway?).
print doesn't start a new line - you need println for that

So you get your 4 in binary printed twice followed by something else (not sure what - maybe something else in your program that you're not showing us?): 10010011
That's 100 100 11 when split up.

27201: <p>I have a very simple sketch, something like this: </p>

<pre><code>int aFour = 4; 
softwareSerial.print(4,BIN); 
softwareSerial.print(aFour,BIN);
</code></pre>

<p>Which gives the following output: </p>

<pre><code>1001
0011
</code></pre>

<p>Why don't they print both as <code>0100</code>? </p>

<p>EDIT: the output was in one line : <code>10010011</code>, I falsely asumed the output should be split into twice 4 bits. </p>
 4143: <ul>
<li><code>print</code> never prints leading zeroes (how many <em>should</em> it print anyway?).</li>
<li><code>print</code> doesn't start a new line - you need <code>println</code> for that</li>
</ul>

<p>So you get your <code>4</code> in binary printed twice followed by something else (not sure what - maybe something else in your program that you're not showing us?): <code>10010011</code></p>

<p>That's <code>100 100 11</code> when split up.</p>
