#include<iostream>
#include<cstdlib>
#include<string>
#include<fstream>
usingnamespace std;
int main()
{
string s="a";
string k="5";
k = k^s;
system("PAUSE");
}
I got an error:no match for 'operator^'.I don't know what bitwise XOR does and i want to find it out by a simple program.Please help me out.Sorry for wasting your time on such simple questions.
Thank you for reading.
std::string doesn't support the bitwise XOR operator.
Change the type of s and k to char and you will be fine.
Note: You will need to change the values assigned to 'a' and '5' (single quotes).