c++用异或对字符串进行加密,结果却为空
#include<fstream>
#include<iomanip>
#include<iostream>
using namespace std;
int main()
{
string k, b, c, d;
int i;
cin>>k;
ifstream ifile;
ifile.open("d:\\a.txt");
ifile>>b;
ifile.close();
for(i=0;i<b.length();i++)
{
c[i]=k[i%k.length()]^b[i];
}
cout<<c<<endl;
ofstream ofile;
ofile.open("d:\\b.txt");
ofile<<c<<endl;
ofile.close();
}
无论怎么搞,c都是空白