title: I am having trouble doing ascii conversion from a string
body: <p>The first code I am posting is supposed to write 222 which is workign fne,I have similar code as part of second program that I am posting which is not working in fact giving me negative result,running on cygwin,trying to get ascii # of a str</p>
  
  <pre><code>int array[]={2,2,2};
  int ugh=0;
  int ok=2;
  for(int i=0;i&lt;3;i++)
      {
          ugh+= (array[i]*pow(10,(ok-i)));
      }
  
  
  int array[size];
      int mesnum=0;
  for (int i=0;i&lt;size;i++)
      {
          array[i]=int(message[i]);
          cout&lt;&lt;array[i]&lt;&lt;endl;
      }
       int something=size-1;
       cout&lt;&lt;something;
      for(int i=0;i&lt;size;i++)
      {
          mesnum+= (array[i]*pow(10,(something-i)));
          cout&lt;&lt;mesnum&lt;&lt;endl;
      }
  
      return mesnum;
  </code></pre>