title: Is it possible to store a leading zero in an int?
body: <p>I have a programming assignment where I need to encrypt a 4 digit int, input by user. I have split the int into four separate values and the encrypt and decrypt functions work. My problem is when I put the four separate ints back together, some numbers encrypt to zero (eg. in:1234 out:0189) and I want to store the output into an int for use with other functions. </p>
  
  <p>Right now I have a half-baked solution that prints 0 first if the first int is 0.</p>
  
  <pre><code>void joinInt(){
      if(int1 == 0) {cout &lt;&lt; 0;}
      joined = int1 * 1000;
      joined += int2 * 100;
      joined += int3 * 10;
      joined += int4;
      cout &lt;&lt; joined &lt;&lt; endl;
      }
  </code></pre>
  
  <p>My goal is to return joined (with the leading zero) rather than just print it within the function.</p>