title: Convert single char to int
body: <p>How can I convert char a[0] into int b[0] where b is a empty dynamically allocated int array</p>
  
  <p>I have tried</p>
  
  <pre><code>char a[] = "4x^0";
  int *b;
  b = new int[10];
  char temp = a[0]; 
  int temp2 = temp - 0;
  b[0] = temp2;
  </code></pre>
  
  <p>I want 4 but it gives me ascii value 52</p>
  
  <p>Also doing</p>
  
  <pre><code>a[0] = atoi(temp);
  </code></pre>
  
  <p>gives me 
  error: invalid conversion from ‘char’ to ‘const char*’
  initializing argument 1 of ‘int atoi(const char*)’</p>