Mam problem ze zkompilowaniem programu oto src code :
#include <Windows.h>
#include <iostream>
using namespace std;
string XORData(string toEncryptDecrypt) {
char key[3] = { 'A', 'B', 'C' }; //Any chars will work
string output = toEncryptDecrypt;
for (int i = 0; i < toEncryptDecrypt.size(); i++)
output[i] = toEncryptDecrypt[i] ^ key[i % (sizeof(key) / sizeof(char))];
return output;
}
int main()
{
string tdata = "abc";
string XORedData = XORData(tdata);
cout << "tdata:" << tdata << "\n"; // tej linijce error
cout << "XORedData:" << XORedData << "\n"; // w tej linijce error
getchar();
return 0;
}
Error : C2679 binary '<<': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)