title: Visual C++ : trying to convert binary to ascii value
body: <p>I have problem with my binary to ASCII conversion what i have done is i have array of text boxes and i am trying to put binary values into that text boxes and passes those values to the function written as below :</p>
  
  <pre><code>System::String^ conversion(const char* input)
  {
       int length = strlen(input);     //get length of string
   int binary[8];    //array used to store 1 byte of binary number (1 character)
   int asciiNum = 0;      //the ascii number after conversion from binary
   System::String^ ascii;      //the ascii character itself
  
       int z = 0;   //counter used
  
   for(int x = 0; x &lt; length / 8; x++)     //reading in bytes. total characters 
   {
       for(int a = 0; a &lt; 8; a++)      //store info into binary[0] through binary[7]
       {
       binary[a] = (int) input[z] - 48;      //z never resets
       z++;
       }
  
    int power[8];    //will set powers of 2 in an array
    int counter = 7;        //power starts at 2^0, ends at 2^7
    for(int x = 0; x &lt; 8; x++)
    {
        power[x] = counter;      //power[] = {7, 6, 5, ..... 1, 0}
        counter--;    //decrement counter each time
    }
  
    for(int y = 0; y &lt; 8; y++)    //will compute asciiNum
    {
        double a = binary[y];    //store the element from binary[] as "a"
        double b = power[y];    //store the lement from power[] as "b"
  
        asciiNum += a* pow(2, b);   
    }
    ascii = System::Convert::ToString(asciiNum);  
  
    asciiNum = 0;    //reset asciiNum for next loop
    return ascii;
  }               
   }
  </code></pre>
  
  <p>the problem is i only get the ASCII value and couldn't get the related character. I want that character any one help me. Thanx in advance.</p>