title: how to convert char array to integer in C?
body: <p>How can I convert the char array <code>x</code> to an integer <strong>89</strong> in the code below? Thank you</p>
  
  <pre><code>int main(int argc,char *argv[]){
      char y[13] = "0123456789012";
      char x[3];
      int integer_value;
  
      x[0] = y[8];
      x[1] = y[9];
      x[3] = '\0';
  
      integer_value=atoi(x);
  }
  </code></pre>