title: Convert From Binary To String In C++
body: <p>In Native C++ I'm coding an application which converts the binary to string.I searched all over the internet to solve my question!But i didn't find any answer matching my question.So can you tell how to do so?I want the console to write "Please enter a binary string: " and when the user types the binary and presses enter the console type "\nThe string value for 'my binary' is\n" and at the down of the sentence the string converted from my binary.</p>
  
  <p>Here is my code but it converts text to binary!!How can i reverse it!!that's what i mean!!</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;bitset&gt;
  #include &lt;windows.h&gt;
  #include &lt;stdio.h&gt;
  
  using namespace std;
  
  int main()
  {
      SetConsoleTitle("Binary To Text Converter 1.0");
  char letter = ' ', playAgain = 'Y';
  string word = " ";
  
  cout &lt;&lt; "\t**Binary To Text Convertor 1.0**\n\n";
  
  while (playAgain == 'Y'){
  
      cout &lt;&lt; "Please Enter A Binary Number: ";
  
      getline (cin, word, '\n');
  
      cout &lt;&lt; "\nThe String Value For '" &lt;&lt; word &lt;&lt; "' Is \n";
  
      for (unsigned int wordPosition = 0; wordPosition &lt; word.size(); ++wordPosition){
  
          letter = word[wordPosition];
  
          bitset &lt;8&gt; binary(letter);
  
          cout &lt;&lt; binary;
          }
  cout &lt;&lt; "\n\nWould You Like To Convert Any Another Binary Number? (Y/N)";
  
      cin &gt;&gt; playAgain;
  
      if (playAgain != 'Y'){
          cout &lt;&lt; "\n\nExiting program.";
          playAgain = 'N';
          }
          cin.ignore();
  }
  
  
  
  return 0;
  }
  </code></pre>