title: invalid conversion from 'int' to 'const char*' [-fpermissive]| (beginner)
body: <p>When I try to compile my code this error pops out:</p>
  <pre class="lang-none prettyprint-override"><code>invalid conversion from 'int' to 'const char*'
  </code></pre>
  <p>My task is to write a program that calculates the sum of numbers with odd index.</p>
  <p>Please don't roast me (I'm learning how to code in c++), and give some tips how to fix it and get my code working.</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;bits/stdc++.h&gt;
  #include &lt;cmath&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      string text;
      cin &gt;&gt; text;
  
      int len = text.length(), sum = 0, number = 0, a = 0;
  
      for (int i = len; i &gt; 0; i++) {
          a = text[i];
          if (i % 2 == 1) {
              number = atoi(a);
              sum = sum + number;
          }
      }
      cout &lt;&lt; sum;
  
      return 0;
  }
  </code></pre>