title: Convert an int array to a single int
body: <p>I'm trying  to convert array[]={1,2,3} into  a int number=123;  how can I do that ?</p>
  
  <p>my code is this: </p>
  
  <pre><code>int main()
  {
  
      int array[]={1,2,3};
      int number;
  
      for (int i =0; 3&lt;i ; i++){
          int val=1;
          for(int j=0; j&lt;i; j++ ){
                  val*=10;
          }
          number += array[i] *val;
  
      }
      cout&lt;&lt;number;
  
      while(1);
      return 0;
  }
  </code></pre>