title: Why my strings are not going to be XOR?
body: <p>I want to encrypt the string of password entered by user, and then print it on screen. Also recover the original password and then print it on screen too. But XOR operator is not working with strings. How can I manipulate it?</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;string.h&gt;
  using namespace std;
  
  int main()
  {
     string pass;
    string enc="akdhigfohre";
    string x;
  
  
     cout&lt;&lt;"Enter new password:  ";
     cin&gt;&gt;pass;
     cout&lt;&lt;"\n\nYour New Password is:" &lt;&lt; pass&lt;&lt;endl;
  
     x=pass^enc;
     cout&lt;&lt;"\n\nEncrypted Version: "&lt;&lt;x;
  
     x=x^enc;
     cout&lt;&lt;"\n\nRecovred Password:  "&lt;&lt;x;
  
     system("pause");
  
  
  
  }
  </code></pre>