title: *Beginner* C: incompatible integer to pointer conversion passing 'char' to parameter of type 'const char *'
body: <p>I'm trying to convert each letter in a string to it's ASCII number.  Using </p>
  
  <pre><code> int letter = (atoi(ptext[i]));
  </code></pre>
  
  <p>gives me this error:</p>
  
  <pre><code>error: incompatible integer to pointer conversion
    passing 'char' to parameter of type 'const char *'; take the
    address with &amp; [-Werror]
      int letter = (atoi(ptext[i]));
                         ^~~~~~~~
                         &amp;
  /usr/include/stdlib.h:148:32: note: passing argument to parameter
        '__nptr' here
  extern int atoi (__const char *__nptr)
  </code></pre>
  
  <p>Here is some of the rest of my code that may be relevant:</p>
  
  <pre><code>    #include &lt;cs50.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;ctype.h&gt;
  
  int main(int argc, string argv[])
  {
  
      printf("Give a string to cipher:\n");
      string ptext = GetString();
  
      int i = 0;
  
      if (isupper(ptext[i]))
      {
          int letter = (atoi(ptext[i]));
      }
  }
  </code></pre>
  
  <p>What am I doing wrong, and how do I fix this so I can convert a string into ASCII values?</p>
  
  <p>Note: <code>cs50.h</code> lets me use "<code>string</code>" instead of "<code>char*</code>" in main.</p>