title: Changing number from character array to int array with decimal value
body: <p>I am starting to learn C and I am having problem with changing numbers from character array to integer array. Here is my Code and I got random number and I have no idea why I am having those numbers.</p>
  
  <p>The answer is <strong>0 , 45, 45, 45</strong>
  and I used 15 for plus sign, 25 for minus, 35 for multiply and 45 for division just for testing.</p>
  
  <p>And also the answer which I want is if <code>char[]="+123"-&gt; int[0]=15;int[1]=1;int[2]=2;int[3]=3;</code></p>
  
  <p>Thanks in advance and very much appreciated!</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(){
      int i=0;
      char retezec[]="123+";
      int array_length=(sizeof(retezec) / sizeof(retezec[0])-1);
      int new_array[50];
      while(retezec[i++]!='\0'){
          switch(retezec[i]){
              case '0':
                  new_array[i]=0;
              case '1':
                  new_array[i]=1;
              case '2':
                  new_array[i]=2;
              case '3':
                  new_array[i]=3;
              case '4':
                  new_array[i]=4;
              case '5':
                  new_array[i]=5;
              case '6':
                  new_array[i]=6;
              case '7':
                  new_array[i]=7;
              case '8':
                  new_array[i]=8;
              case '9':
                  new_array[i]=9;
              case '+':
                  new_array[i]=15;
              case '-':
                  new_array[i]=25;
              case '*':
                  new_array[i]=35;
              case '/':
                  new_array[i]=45;
          }
      }
      for(int i=0;i&lt;array_length;i++){
          printf("%d\n",new_array[i]);
      }
  } 
  </code></pre>