By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,334 Members | 2,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,334 IT Pros & Developers. It's quick & easy.

error: request for member ‘length’ in ‘k’, which is of non-class type ‘int’

P: 1
string decrypt(string e_msg, int k){
int i;
while (e_msg.length() > k.length())
{
k += k;
}
string decrypt_Text = "";
for (i = 0; i <= e_msg.length(); i++)
{

decrypt_Text += e_msg[i] ^ k;
}
cout << "the messege is:" << decrypt_Text << endl;
return decrypt_Text;
}
Oct 21 '16 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
k is an int.

Did you mean to say k is a string?
Oct 21 '16 #2

Post your reply

Sign in to post your reply or Sign up for a free account.